Skip to content

React should *only* be a peer dependency  #70

@timothyarmes

Description

@timothyarmes

I've just upgraded to React 17, and my code is now failing due to a this error:

Uncaught Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app

Running npm ls react (as suggested here: https://reactjs.org/warnings/invalid-hook-call-warning.html) tells me that frontend-collective-react-dnd-scrollzone is pulling in React 16.

If you see more than one React, you’ll need to figure out why this happens and fix your dependency tree. For example, maybe a library you’re using incorrectly specifies react as a dependency (rather than a peer dependency).

You are specifying React as a peer dependency, but you're also specifying it directly in devDependencies. Can you please remove the direct dependency?

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