-
Notifications
You must be signed in to change notification settings - Fork 24.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move "react" to be a peer dependency #5541
Comments
Definite +1! |
This is going to require a bit of work. These are the steps:
|
react-native init Does So we can run arbitrary script that's going to add a peer dependency after the fact and re-run npm install without changing the shell |
Nice, that makes things a lot smoother... |
Yeah, @frantic did a good job designing the global cli such that it is future proof :) |
May I know when this fix will probably be released? |
#5813 landed and will be released in 0.22 |
@facebook-github-bot close |
@janicduplessis tells me to close this issue. If you think it should still be opened let us know why. |
By moving "react" out of "dependencies" and into "peerDependencies" this unlocks the next level of universal code sharing. Packages like react-redux can have a peer dependency on the same copy of "react" that's used by RN. Short of abusing npm 3's package flattening, I believe this is the proper way forward.
Example package.json:
... and that's it. This would be a breaking change, but the fix is very simple (add "react" to the app's dependencies). With the fbjs patches landing, this will be hopefully the final step to compatibility with React Redux, Relay, and the greater React ecosystem.
The text was updated successfully, but these errors were encountered: