r/reactnative • • Oct 09 '26

Help Turbo Modules

I don't want to depend everytime on third party code, so in order to learn to bulid my own solutions without any abstraction how much C++ do i have to learn? And in what parts/concepts do i have to focus?

1 Upvotes

14 comments sorted by

View all comments

2

u/rakadoank Oct 11 '26 edited Oct 11 '26
  1. You need basic C++ knowledge, including its toolkit like CMake, but you could just start with community template
  2. If you do know C++, you have to learn JSI which to create a JavaScript value like number, string, and objects from C++. It is quite easy tho
  3. You need basic understand about static linking with Turbo Modules, Codegen, and react-native.config.js, so RN host app recognizes your codes in Local development and through NPM registry. This is also kind of related to your JavaScript project setup with Bun/PNPM/Yarn.

Try to visit exisiting project, such as Reanimated, Safe Area Context, etc, you can follow how do they work.

You can also visit my https://github.com/RakaDoank – I am currently only have one C++ RN Module.


Advanced Guide, but it is super not recommended if you do not know what you are doing., Learn bridgeless which you are not using Turbo Modules for your C++ module. Basically your C++ is just polutting the global instance of JavaScript, similar how does Turbo Modules actually do behind the scene. The difficult part is to get JavaScript Runtime from Kotlin Android, Obj-C iOS, and provide to your C++ code. @op-engineering/op-sqlite is literally bridgeless. Turbo Modules is still bridgless by the way, but Turbo Modules provides a thin bridge for a safety call from-to TypeScript/Flow and C++

0

u/vaquishaProdigy Oct 11 '26

Souds pretty fun