Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mixed information on the internet #1622

Closed
c0debreaker opened this issue Feb 23, 2017 · 3 comments
Closed

Mixed information on the internet #1622

c0debreaker opened this issue Feb 23, 2017 · 3 comments

Comments

@c0debreaker
Copy link

I've been searching the web to find out if there is no need for us to install lodash if we're using create-react-app. Some forums said there is no need to install it. All you have to do is import _groupBy from 'lodash/groupby'. Some said you will have to install lodash manually. So which one is correct? I couldn't get the former to work so I had to npm install --save lodash manually.

@Timer
Copy link
Contributor

Timer commented Feb 23, 2017

If you're using a dependency you must install it. We do not automate this step.
I'm not sure what you are reading?

Anyway, let me know if there's anything else you need help with! 😄

@Timer Timer closed this as completed Feb 23, 2017
@gaearon
Copy link
Contributor

gaearon commented Feb 23, 2017

Some forums said there is no need to install it. All you have to do is import _groupBy from 'lodash/groupby'.

Absolutely not, this is wrong and dangerous. It happens to work because Lodash is a transitive dependency of some of the build tools we are using. However, its version may change any time you run npm install because a transitive dependency that uses it might release a patch update that changes a major version of Lodash. Or it may even remove it. So your app will be extremely fragile.

If you use a dependency you must run npm install --save <dependency name>. This is described in the User Guide.

Hope this helps!

@c0debreaker
Copy link
Author

Thanks folks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants