You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
Activity
Timer commentedon 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! 😄
gaearon commentedon Feb 23, 2017
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 installbecause 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 commentedon Feb 26, 2017
Thanks folks!