Move react as peerDependency
See original GitHub issueFirst of all great work on this package.
I have come across an issue of multiple react
installations. This was not a problem during development and bundling for production but more in testing. The tests just fail when run in combination with Create React App with an error saying that there may be more than once installations of react
. I did npm ls react
at root level and found that is the case:
components@1.0.0 components
├─┬ media-gallery@1.0.1 -> components/src/packages/media-gallery
│ └─┬ react-image-gallery@0.8.18
│ └── react@16.9.0
└── react@16.9.0
I think moving react
to be as a peerDependency
would resolve this or similar problems. This obviously be a breaking change so would require a major release in case it goes ahead.
Let me know what you think. Cheers
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Move React and React DOM to peer dependencies #2052
Describe the problem Because react and react-dom packages are added as direct dependencies with compatible versions, adding this project in ...
Read more >Understanding Peer Dependencies in JavaScript
In this case, you would declare React as a peer dependency for your components, because you want the host project to have the...
Read more >What is the correct way of adding a dependency to react in ...
For reusable components: Put a react dependency in both peerDependencies and devDependencies . Never put a react dependency in dependencies ...
Read more >A tip on using peer dependencies with TypeScript
React is now a peer dependency, which means the main application needs to list it in its own dependencies. Additionally, we're able to...
Read more >Dependency Management | React Native Developer Tools
It then got moved out to the React Native Community organization as ... will suggest that we change peerDependencies and devDependencies to the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
released in v0.9.0
@jabranr Thanks, I reviewed your pr and the changes shouldn’t be breaking. If you can tweak the pr I can merge.