react-native-monorepo-tools
react-native-monorepo-tools copied to clipboard
Dependencies, that have `react-native` as a `peerDependency`, resolve to the wrong version of `react-native`
See https://github.com/mmazzarolo/react-native-universal-monorepo/issues/22#issuecomment-950137606 for more info on the issue.
Solution:
Update react-native-monorepo-tools
to block react-native-reanimated/node_modules/react-native
(or from react-native-svg, which is what I just tried). From my testing, just adding something like blockList.push(new RegExp(
node_modules/react-native-svg/node_modules/react-native/.*));
at line 46 here should be enough (you can try editing it directly in your node_modules/react-native-monorepo-tools and restarting the metro server). Of course it'd need to be made a bit more dynamic (e.g., by applying this rule to all nohoisted libs) but it can be a starting point.