UNPKG

1.08 kBJavaScriptView Raw
1import { setRecoveryPropsToSave } from './ErroRecoveryStore';
2import ExpoErrorRecovery from './ExpoErrorRecovery';
3import './ErrorRecovery.fx';
4// @docsMissing
5export const recoveredProps = _getRecoveredProps();
6// @needsAudit
7/**
8 * Set arbitrary error recovery props. If your project crashes in production as a result of a fatal
9 * JS error, Expo will reload your project. If you've set these props, they'll be passed to your
10 * reloaded project's initial props under `exp.errorRecovery`. Access to `localStorage` is required
11 * on web, or else this will simply be a no-op.
12 *
13 * [Read more about error handling with Expo](/guides/errors).
14 * @param props An object which will be passed to your reloaded project's initial props if the
15 * project was reloaded as a result of a fatal JS error.
16 */
17export function setRecoveryProps(props) {
18 setRecoveryPropsToSave(props);
19}
20function _getRecoveredProps() {
21 if (ExpoErrorRecovery.recoveredProps) {
22 return JSON.parse(ExpoErrorRecovery.recoveredProps);
23 }
24 return null;
25}
26//# sourceMappingURL=ErrorRecovery.js.map
\No newline at end of file