Turbo Modules vs Native Modules in React Native

Nagarjun E
2 min readFeb 9, 2024

Turbo Modules

Introduced in React Native 0.60.

Aim to improve the performance of React Native applications by introducing a new communication mechanism between JavaScript and native code.

Utilizes a custom binary protocol for data transfer, which is more efficient and faster than traditional JSON-based communication.

Allows for direct method calls without the need for intermediate JavaScript bridges, reducing overhead and improving latency.

Provides a dedicated thread for handling Turbo Module communication, ensuring responsiveness and avoiding performance bottlenecks in the main JavaScript thread.

Offers a more straightforward and concise syntax for defining native modules, making it easier for developers to create and maintain them.

Requires manual integration into the application, as it is not automatically enabled.

Native Modules

Part of the React Native core since its inception.

Provides a mechanism for interacting with native platform features from JavaScript code.

Utilizes a JavaScript bridge to communicate with native code, which involves marshalling data between JavaScript and native formats.

Exposes native APIs as JavaScript functions, allowing developers to call them directly from their React Native components.

Typically implemented in Java (for Android) or Objective-C/Swift (for iOS).

Automatically included in React Native applications, making them readily accessible to developers.

Comparison

Comparison of Turbo and Native Modules

Conclusion

Turbo Modules and Native Modules serve different purposes in React Native. Turbo Modules prioritize performance and efficiency by introducing a more optimized communication mechanism between JavaScript and native code. Native Modules, on the other hand, provide a more comprehensive and convenient way to interact with native platform features, with the trade-off of being less performant. Developers can choose the appropriate module type based on their specific requirements and performance considerations.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Nagarjun E
Nagarjun E

Written by Nagarjun E

Today I choose life. Every morning when I wake up I can choose joy, happiness, negativity, pain. To feel the freedom that comes from being able to continue to

No responses yet

Write a response