Installation
Installation is the place to confirm that the package is present and the native module is actually available to the app. Work through this page if you need the iOS pod step, Android autolinking expectations, or the basic checks that catch an incomplete native setup early. Once this is done, you can move on to handler registration with confidence that the library is wired correctly.
Requirements
- React Native 0.68 or later
- iOS or Android target app
- TypeScript only if you want typed handlers and option objects
Architecture support
The package is designed to work with both React Native architecture modes:
- legacy architecture projects
- new architecture projects using TurboModules and Fabric
You do not need a separate install path for the new architecture in most setups. If you run into TurboModule registration issues after install, use the Troubleshooting steps to clear caches and rebuild the native app.
Install the package
- npm
- Yarn
- pnpm
- Bun
npm install react-native-global-exception-handler
yarn add react-native-global-exception-handler
pnpm add react-native-global-exception-handler
bun add react-native-global-exception-handler
iOS setup
Run CocoaPods after installation:
cd ios && pod install
No additional manual iOS integration is required for the standard setup.
Android setup
The Android native module auto-links in supported React Native versions. In most projects there are no extra manual Gradle steps beyond rebuilding the app.
If your app uses the new architecture and the native module is not registered, the usual fix is to clear Metro and native build caches, then rebuild from scratch. Those commands are listed in Troubleshooting.
TypeScript support
Types are bundled with the package:
import type {
CrashType,
ExceptionHandlerOptions,
JSExceptionHandler,
NativeExceptionHandler,
} from 'react-native-global-exception-handler';
After installation
Once the package is installed:
- Follow Getting Started to register the handlers.
- Review Basic Usage for entry-point setup.
- Read Native Crash Handling before testing release behavior.
- Use Troubleshooting if pods, builds, or module registration fail.