Closed appjitsu closed 4 years ago
Hello @appjitsu ,
Do you still have this error ? Did you try to update RN ?
I have different problem but I believe the root cause is the same. The problem is that react-native-toastify includes all react and react-native stuff as direct dependencies. How this should be done is through peer dependencies instead.
I think package.json of this library should look something like this:
"dependencies": {
"prop-types": "15.x"
},
"peerDependencies": {
"react": "16.x",
"react-dom": "16.x",
"react-native": ">= 0.56 < 1" (or whichever is the minimum version)
}
The tricky part is to find out best possible versions for the peer dependencies. The ones that are least restrictive are best rules.
You can verify that the current configuration causes real problems by initiating a fresh RN project with latest RN version and adding react-native-toastify as a dependency - a red box will appear on the emulator.
Hello @ronkot ,
Could you please test this @rimiti/react-native-toastify@1.2.2-0 version and let me know if it's now ok. 🙏
I confirm you that's working well:
Nice, super speed fix 😄 🎉
Using exact version numbers as a peer dependency will cause version mismtach warnings for most users, but it should not affect the behavior. If you want to refine the fix further, just use peer dependency version range as I suggested in https://github.com/rimiti/react-native-toastify/issues/11#issuecomment-668392449.
Anyway, super work. Thanks for this library! 💪
Aha!
Thanks for your contribution 🙏
New PR related to your last comment. #20
Paths: /Users/user/myapp/app/node_modules/@rimiti/react-native-toastify/node_modules/react-native/package.json collides with /Users/user/myapp/app/node_modules/react-native/package.json