Should React/ReactDOM be peer dependencies?
I just ran into a super strange issue where webpack loaded both React 15 and React 0.14, causing all kinds of crazy hell 🔥 Upgrading formidable-landers to v2 should solve my issue, but I can foresee this happening again with the next major React release.
Is there any downside to changing React and ReactDOM to peer dependencies with major version ranges like so?
"peerDependencies": {
"react": "^0.14.0 || ^15.0.0-0",
"react-dom": "^0.14.0 || ^15.0.0-0"
}
This way Webpack doesn't assume a hard dependency on specific React versions and doesn't try to load two copies 😄
@tptee -- We should be able to override and manually specify resolution behavior. If you have a reproduction, I can help you work through it tomorrow...
I ran into this issue with loading multiple copies of Radium, and I wondered the same thing!
I am happy to move them both to peerDependencies if that makes the most sense. Let me know how it shakes out.
On Jun 6, 2016, at 21:17, Ryan Roemer [email protected] wrote:
@tptee -- We should be able to override and manually specify resolution behavior. If you have a reproduction, I can help you work through it tomorrow...
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
@tptee @paulathevalley -- As a head's up, the starting point is using inspectpack with --action=versions which will tell us a lot about why different libs are coming in and from where
If you get a chance, I'd recommend both reading the inspectpack docs and seeing if you can do a custom build for inspect pack and run the analysis. (For your understanding and to dogfood our documentation).