Search code examples
react-nativereact-native-turbomodulereact-native-fabric

Is it possible to use both Fabric and Turbo in a React Native library?


I'm new to React Native Architecture, and I was trying to make a library using the community tool: npx create-react-native-library@latest my-awsome-library, but I get confronted with the choice of selecting either Fabric or Turbo. I tried to merge them both, but I get compilation errors like:

[CXX1429] error when building with cmake using /Users/MyUser/Sources/my-awsome-library/example/node_modules/react-native/ReactAndroid/cmake-utils/default-app-setup/CMakeLists.txt

So I'm wondering if it's even possible to use both on the same library, because I have a use case where I need to setup some configuration and keys on each platform before I can use Fabric to use the views.


Solution

  • This might help you in package.json. Add codegenConfig as mentioned in documentation: "type": "all"

    Enable the new architecture for libraries: Prerequisites, define specifications in JavaScript