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

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

1

u/Substantial-Swan7065 Oct 09 '26

0 c++. Kotlin and swift

1

u/vaquishaProdigy Oct 09 '26

You sure? They have some abstraction too

2

u/kokerali Oct 09 '26

Yes, they still have abstraction. Owning a native implementation and removing React Native's interface layer are different goals. Turbo Modules use a typed spec and Codegen-generated native interfaces; even the pure C++ route still uses specs and Codegen. C++ isn't an abstraction-free escape hatch.

If you want to replace a third-party wrapper around a platform API, I'd start with one method from the native module guide, then trace the call from JavaScript through the generated interface into your implementation and the platform API. That gives you a concrete boundary to understand rather than a whole language to master first.

If instead you need the same platform-independent algorithm on both Android and iOS, the C++ route is more relevant. For that first module, I'd prioritize object lifetime/RAII, ownership, references versus copies, and compiling/linking a small library. What specific dependency or native feature are you trying to replace? That would make the learning path much less vague.

1

u/Substantial-Swan7065 Oct 09 '26

Oh you right. I was thinking about something else.

It’s still abstraction tho

1

u/beepboopnoise Oct 10 '26

Whenever someone says “there is no reason not use RN” I’m reminded of posts like these

2

u/PrimaryFamous6139 Oct 09 '26

You don’t need to master C++ to build Turbo Modules. Start with the basics: types, classes, pointers/references, memory management, and how C++ interacts with JavaScript through JSI. Also learn React Native’s Codegen and the Turbo Module spec. Build one simple native module first, then move to C++ only when you actually need cross-platform native logic

1

u/tr__18 iOS & Android Oct 09 '26

Hey, in future I want to try open source contributions. I will be learning kotline and swift first ( basic ) and then if required c++.

Will this be enough for the c++ part ?

2

u/tr__18 iOS & Android Oct 09 '26

After today's headache, I am feeling the same thing. I should build mine own compenent rather than loading a whole big ass package

1

u/Few-Acanthisitta9319 Oct 11 '26

What headache?

1

u/tr__18 iOS & Android Oct 11 '26

I joined as an replacement of a developer. And he has installed library for basic stuffs. That things can be replicated by just simple native modules stuff.