1

I am working on an app which uses the Reflux framework around React. When we want to use an external library in a file we require with:

import _ from 'lodash';

Then we can use the _. to access all the lodash methods. I would like to also like to be able to access _. in the javascript console when developing. Is there a way to require lodash so that it is available there?

wuliwong
  • 4,238
  • 9
  • 41
  • 69

1 Answers1

1

You can mount it in componentDidMount() in some component. like:

componentDidMount() {
  window._ = _;
}
ijse
  • 2,998
  • 1
  • 19
  • 25