Skip to content

Mixed information on the internet #1622

Closed

Description

@c0debreaker

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.

Activity

  1. Timer commented on Feb 23, 2017

    @Timer
    Contributor

    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! 😄

  2. gaearon commented on Feb 23, 2017

    @gaearon
    Contributor

    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!

  3. c0debreaker commented on Feb 26, 2017

    @c0debreaker
    Author

    Thanks folks!

  4. locked and limited conversation to collaborators on Jan 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions