UNPKG

2.16 kBSource Map (JSON)View Raw
1{"version":3,"file":"withExpoRoot.js","sourceRoot":"","sources":["../../src/launch/withExpoRoot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,aAAa,MAAM,gCAAgC,CAAC;AAC3D,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AAGpD,MAAM,CAAC,OAAO,UAAU,YAAY,CAClC,gBAAwC;IAExC,OAAO,SAAS,QAAQ,CAAC,KAAQ;QAC/B,MAAM,aAAa,GAAG,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC1C,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE;YAC1B,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC;YACtB,IAAI,GAAG,CAAC,YAAY,EAAE;gBACpB,aAAa,CAAC,uBAAuB,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;aACzD;YAED,aAAa,CAAC,OAAO,GAAG,IAAI,CAAC;SAC9B;QAED,MAAM,aAAa,GAAG;YACpB,GAAG,KAAK;YACR,GAAG,EAAE,EAAE,GAAG,KAAK,CAAC,GAAG,EAAE,aAAa,EAAE,aAAa,CAAC,cAAc,EAAE;SACnE,CAAC;QAEF,IAAI,OAAO,IAAI,QAAQ,CAAC,EAAE,KAAK,SAAS,EAAE;YACxC,OAAO,CACL,oBAAC,iBAAiB;gBAChB,oBAAC,gBAAgB,oBAAK,aAAa,EAAI,CACrB,CACrB,CAAC;SACH;aAAM;YACL,OAAO,oBAAC,gBAAgB,oBAAK,aAAa,EAAI,CAAC;SAChD;IACH,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import * as ErrorRecovery from 'expo-error-recovery';\nimport * as React from 'react';\nimport { Platform } from 'react-native';\n\nimport Notifications from '../Notifications/Notifications';\nimport RootErrorBoundary from './RootErrorBoundary';\nimport { InitialProps } from './withExpoRoot.types';\n\nexport default function withExpoRoot<P extends InitialProps>(\n AppRootComponent: React.ComponentType<P>\n): React.ComponentType<P> {\n return function ExpoRoot(props: P) {\n const didInitialize = React.useRef(false);\n if (!didInitialize.current) {\n const { exp } = props;\n if (exp.notification) {\n Notifications._setInitialNotification(exp.notification);\n }\n\n didInitialize.current = true;\n }\n\n const combinedProps = {\n ...props,\n exp: { ...props.exp, errorRecovery: ErrorRecovery.recoveredProps },\n };\n\n if (__DEV__ && Platform.OS === 'android') {\n return (\n <RootErrorBoundary>\n <AppRootComponent {...combinedProps} />\n </RootErrorBoundary>\n );\n } else {\n return <AppRootComponent {...combinedProps} />;\n }\n };\n}\n"]}
\No newline at end of file