Skip to content

react-dom includes react #5282

@mvolkmann

Description

@mvolkmann

My project uses react, react-dom, and react-bootstrap.
react-bootstrap requires react to be a peer dependency.
react-dom includes react as a child dependency.
So I must install react as a top-level dependency in order for react-bootstrap to work.
Now I have two copies of react.
When I try to use the Modal component in react-bootstrap, I get the error "Uncaught Error: Invariant Violation: addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component's render method, or you have multiple copies of React loaded".
I can fix this by deleting the directory node_modules/react-dom/node_modules/react.
Maybe react-dom should be changed so react is a peer dependency instead of a child dependency.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions