Can react-native-tvos and react-native co-exist in the same nx monorepo?

110 Views Asked by At

I have a NX monorepo used for multiple React and ReactNative applications. I want to include TV support using the react-native-tvos package. I'm unclear about how that package can coexist with the stock react-native package as they both use the same react-native node_module folder.

Any advice would be appreciated.

Note: I'm not asking for generating a react-native-tvos application using nx. The plan there is to run the create script for TVOS separate and manually migrate the default App into the NX mono-repo (making the standard changes to package.json, tsconfig, etc).

I see a couple possibilities:

  1. Just use react-native-tvos across all react-native applications (include mobile only ones)
  • Pros:
    • Should just work
  • Cons:
    • Additional TVOS deps added across all projects
    • tvos update cycle does not always match regular react-native
  1. Install react-native-tvos as a local package in a distinct react-native-tvos folder. Then use a module resolver to map react-native to react-native-tvos (similar to how react-native-web works).
  • Pros:
    • Should work for the JS/TS side
  • Cons:
    • Not sure how any native build tooling that relies on node_modules/react-native path existing to be converted to use the tvos folder instead.
0

There are 0 best solutions below