mmazzarolo / react-native-monorepo-tools

Tools and utils to support a React Native monorepo built with Yarn Workspaces

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dependencies, that have `react-native` as a `peerDependency`, resolve to the wrong version of `react-native`

mmazzarolo opened this issue · comments

See mmazzarolo/react-native-universal-monorepo#22 (comment) 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.