This repository has been archived on 2022-03-12. You can view files and clone it, but cannot push or open issues or pull requests.
2021-04-02 02:24:13 +03:00

21 lines
822 B
JavaScript

import * as ErrorRecovery from 'expo-error-recovery';
import * as React from 'react';
import Notifications from '../Notifications/Notifications';
export default function withExpoRoot(AppRootComponent) {
return function ExpoRoot(props) {
const didInitialize = React.useRef(false);
if (!didInitialize.current) {
const { exp } = props;
if (exp.notification) {
Notifications._setInitialNotification(exp.notification);
}
didInitialize.current = true;
}
const combinedProps = {
...props,
exp: { ...props.exp, errorRecovery: ErrorRecovery.recoveredProps },
};
return React.createElement(AppRootComponent, Object.assign({}, combinedProps));
};
}
//# sourceMappingURL=withExpoRoot.js.map