You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How can this line work if there is no mention of react-native in package.json?
importReactfrom'react-native';
I understand that there is an assumption that if anyone is requireing native.js, that they will already have react-native included in their project deps, but it seems very odd that a library could have an import of a package not mentioned in its package.json.
Am I wrong? I'm trying to understand this mechanism to duplicate it in my own project, and this is confusing me. Could you add a peer dep that didn't cause problems for people just using plain react, or is this just a strangeness of the npm dep system?
The text was updated successfully, but these errors were encountered:
It wouldn't make sense to force installation of react-native onto people using react, and vice versa. This is why neither is in peerDependencies in package.json.
Yes, we assume the users are already using either of them. I agree it's kinda weird, but it's a better solution than forcing users to install both packages. (Especially considering they might get weird issues when react-native users get react installed side by side.)
This is going to be moot soon after 0.14 is out (and compatible RN release is out) anyway because Component and friends will be inside react package for both platforms, and react-native will become a yet another renderer, just like react-dom. When this happens we'll kill react-redux/native entry point, and everyone will be able to use react-redux directly regardless of the platform. This is when we can introduce a peer dependency.
How can this line work if there is no mention of
react-native
inpackage.json
?I understand that there is an assumption that if anyone is
require
ingnative.js
, that they will already havereact-native
included in their project deps, but it seems very odd that a library could have animport
of a package not mentioned in itspackage.json
.Am I wrong? I'm trying to understand this mechanism to duplicate it in my own project, and this is confusing me. Could you add a peer dep that didn't cause problems for people just using plain
react
, or is this just a strangeness of the npm dep system?The text was updated successfully, but these errors were encountered: