React Native - TurboModules

TurboModules are the new way in React Native to interact with the native side. They were introduced in React Native's new architecture to speed up the way Native Modules are initialized and invoked from JavaScript.

Limitations of current Native Modules implementation.

React Native uses Native Modules to invoke functions on the native side. Due to the unawareness between the JS and native side, the Native Modules utilized by JavaScript code must be initialized when the app is started, even though some of those Native Modules are never used.  

Due to the initialization of Native Modules at the start of the application, the start-up time of the application increased.

There isn't a straightforward way to determine whether the Native Modules that JavaScript calls are indeed present in the native app. With over-the-air updates, there is no simple way to determine whether a newer version of JavaScript calls the correct method in the Native Module, and also, if the arguments passed are correct.

With the inclusion of JSI (JavaScript Interface), a method in JavaScript can have a direct reference to the native objects and invoke a method on them.

Using the new TurboModules approach, the JavaScript code may hold a direct reference to each module and only load it when it is actually required. This eliminates the necessity for the old bridge's communication. This will also improve the start-up time of applications with a lot of Native Modules as they are loaded when required.

To enable TurboModules in your React Native app follow these steps.
For Android -

For iOS -

Dhruv Tailor

Dhruv Tailor

Software Engineer developing mobile apps at PLG Works
Surat, Gujarat