Back to React Native tutorials
Advanced19 min read

Native Modules

Bridge JavaScript to native iOS and Android code and integrate third-party SDKs.

When You Need Native Code

Use native modules when SDKs lack JS bindings, hardware access requires platform APIs, or performance-critical code must run outside JS thread.

Turbo Modules and the New Architecture improve bridge throughput with codegen from TypeScript specs.

Prefer well-maintained community libraries before writing custom bridges—maintenance cost is high.

  • Audit license compatibility of native SDKs
  • Document manual linking steps for bare workflow teammates
  • Test New Architecture compatibility when upgrading RN

iOS and Android Modules

iOS modules use Swift or Objective-C exported with RCT_EXTERN_MODULE. Android modules extend ReactContextBaseJavaModule or Kotlin equivalents registered in packages.

Expose methods to JS with @ReactMethod. Callbacks and Promises return async native results.

Use CocoaPods on iOS and Gradle on Android to pull native dependencies; rebuild native apps after changes.

  • Run pod install and clean builds after native changes
  • Handle permissions before calling camera or location APIs
  • Version native module API alongside JS semver
// NativeModule example call from JS
import { NativeModules } from 'react-native';
NativeModules.MyPrinter.printReceipt(data);

Get In Touch


Ready to discuss your next project? Drop me a message.