Part 5 · Applications

Expo Modules: one API, two platforms

Prerequisites: 02-jsi-versus-bridge

Expo Modules: one API, two platforms — mechanism

The same JS interface leads to separately implemented platform behavior; Expo is an abstraction over the RN boundary. Nodes: JS/TS wrapper, Expo Modules API, Swift module, Kotlin module.
The same JS interface leads to separately implemented platform behavior; Expo is an abstraction over the RN boundary. [S06] [S07]

Mental model verified

Expo Modules API abstracts JSI and related RN primitives. A module definition names the JS-visible surface. Function executes synchronously on the JS runtime thread; AsyncFunction returns a Promise and by default dispatches native work away from that thread.

[S06] [S07]

Worked example synthesis

A biometric SDK wrapper could expose isAvailable as a small cached query and authenticateAsync as an asynchronous operation. Swift and Kotlin implement the same JS-facing intent while each platform handles its own permission and result behavior.

[S07]

Engineering choice synthesis

Prefer the Expo DSL for a Swift/Kotlin integration when its API fits. Use a TurboModule when the module needs direct C++ access or RN Codegen contracts. Profile before attributing bottlenecks to either framework.

[S05] [S06]

Pitfall and next step verified

AsyncFunction does not mean “runs on the UI thread.” Explicitly choose the main queue for UI work; view-bound async methods have their own main-thread behavior. Define failure and cancellation semantics.

[S07]
Keep this: Expo’s Swift/Kotlin DSL exposes Function, AsyncFunction, events and views over React Native’s low-level primitives.
Check yourself: When should an Expo module use AsyncFunction instead of Function?

For I/O, long work, or work that must be dispatched to another queue; a synchronous Function runs on the JS caller thread.

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. [S07] Expo Modules API: Reference

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

    Supports: JSI abstraction; Function, AsyncFunction, queues, views, events and lifecycle.

    Read the diagrams and API boundaries for jsi abstraction; function, asyncfunction, queues, views, events and lifecycle.