Part 4 · Applications

TurboModule: typed service API

Prerequisites: 02-jsi-versus-bridge

TurboModule: typed service API — mechanism

A nonvisual native service contract. Language details and generated glue vary by module implementation. Nodes: TS/Flow spec, Codegen, Android, iOS.
A nonvisual native service contract. Language details and generated glue vary by module implementation. [S05] [S11]

Mental model verified

A TurboModule exposes functions and events. A TypeScript or Flow spec describes types, Codegen emits platform glue, and native Android/iOS implementations fulfill that contract. Fabric components handle native views separately.

[S05] [S11]

Worked example synthesis

Define getBatteryLevel(): Promise<number> in a typed module spec, implement the platform query separately in Kotlin and Swift/Objective-C++, and handle rejection or missing capability in JS. This is pseudocode for contract shape, not copy-paste setup.

[S05]

Engineering choice synthesis

Choose TurboModule when you need RN Codegen contracts or lower-level C++ integration. Keep the exported surface small and versioned; errors and nullability belong in the API design.

[S05] [S06]

Pitfall and next step synthesis

Generated types do not make platform behavior identical. Test permission denial, lifecycle and device-specific availability on both platforms.

[S05] [S11]
Keep this: A typed JS specification and Codegen tie a native service contract to Android and iOS implementations.
Check yourself: Is a TurboModule the path for custom native visual components?

Use a native component/Fabric view for visual surfaces; a TurboModule exposes nonvisual native functions and events.

Sources & further reading

  1. [S05] Native Modules: Introduction

    React Native · official documentation · accessed 2026-10-08 · current documentation as accessed

    Supports: Typed TS or Flow spec and platform-specific Codegen interfaces.

    Read the diagrams and API boundaries for typed ts or flow spec and platform-specific codegen interfaces.

  2. [S06] Expo Modules API: Overview

    Expo · official documentation · accessed 2026-10-08 · current documentation as accessed

    Supports: Expo Modules API uses Swift and Kotlin and supports the New Architecture.

    Read the diagrams and API boundaries for expo modules api uses swift and kotlin and supports the new architecture.

  3. [S11] Emitting Events in Native Modules

    React Native · official documentation · accessed 2026-10-08 · current documentation as accessed

    Supports: Native-to-JS events in TurboModules.

    Read the diagrams and API boundaries for native-to-js events in turbomodules.