HomeGuidesReferenceLearn

Expo ErrorRecovery

GitHub

npm


Deprecated. This module will be removed in SDK 47. This package is not utilized in projects built outside of the deprecated classic build system (expo build:ios & expo build:android). For similar functionality, use the built-in error handling of expo-updates. You can also use a third-party crash reporting service like Sentry or Bugsnag with EAS Build.

This module provides utilities for helping you gracefully handle crashes due to fatal JavaScript errors.

Platform Compatibility

Android DeviceAndroid EmulatoriOS DeviceiOS SimulatorWeb

Installation

Terminal
npx expo install expo-error-recovery

If you're installing this in a bare React Native app, you should also follow these additional installation instructions.

API

import * as ErrorRecovery from 'expo-error-recovery';

Component

setRecoveryProps

Type: React.Element<ErrorRecoveryProps>

Set arbitrary error recovery props. If your project crashes in production as a result of a fatal JS error, Expo will reload your project. If you've set these props, they'll be passed to your reloaded project's initial props under exp.errorRecovery. Access to localStorage is required on web, or else this will simply be a no-op.

Read more about error handling with Expo.

Constants

Types

ErrorRecoveryProps

Type: Record<string, any>

Was this doc helpful?