This is a React Native project, following the guide on C++ Turbo Native Modules.
With the new React Native Architecture, we can create Turbo Native modules using C++, providing a way to share the same implementation across supported platforms such as Android, iOS, macOS, or Windows.
- Enable New Architecture
- Turbo Module Folder Setup
- In this project, it is located in the
tm
folder.
- In this project, it is located in the
- JavaScript Specification
- Codegen Configuration
- Module Registration
- C++ Native Code
- Adding the C++ Turbo Native Module in
App.ts
It's crucial to remember that after any changes in the C++ code, you need to run codegen again.
To run codegen on iOS, use the following command:
RCT_NEW_ARCH_ENABLED=1 bundle exec pod install
To run codegen on Android, use the following command:
yarn android