UNPKG

repoweaver

Version:

A GitHub App that skillfully weaves multiple templates together to create and update repositories with intelligent merge strategies

1 lines 4.71 kB
{"ast":null,"code":"import \"../Expo.fx\";\nimport AppRegistry from \"react-native-web/dist/exports/AppRegistry\";\nimport Platform from \"react-native-web/dist/exports/Platform\";\nexport default function registerRootComponent(component) {\n let qualifiedComponent = component;\n if (process.env.NODE_ENV !== 'production') {\n const {\n withDevTools\n } = require(\"./withDevTools\");\n qualifiedComponent = withDevTools(component);\n }\n AppRegistry.registerComponent('main', () => qualifiedComponent);\n if (Platform.OS === 'web' && typeof window !== 'undefined') {\n const rootTag = document.getElementById('root');\n if (process.env.NODE_ENV !== 'production') {\n if (!rootTag) {\n throw new Error('Required HTML element with id \"root\" was not found in the document HTML.');\n }\n }\n AppRegistry.runApplication('main', {\n rootTag,\n hydrate: globalThis.__EXPO_ROUTER_HYDRATE__\n });\n }\n}","map":{"version":3,"names":["AppRegistry","Platform","registerRootComponent","component","qualifiedComponent","process","env","NODE_ENV","withDevTools","require","registerComponent","OS","window","rootTag","document","getElementById","Error","runApplication","hydrate","globalThis","__EXPO_ROUTER_HYDRATE__"],"sources":["/Users/pmouli/Documents/GitHub.nosync/boots-strapper/mobile/node_modules/expo/src/launch/registerRootComponent.tsx"],"sourcesContent":["import '../Expo.fx';\n\nimport { type ComponentType } from 'react';\nimport { AppRegistry, Platform } from 'react-native';\n\ndeclare namespace globalThis {\n // TODO(@kitten): What's the proper type here? What would AppRegistry need to accept?\n const __EXPO_ROUTER_HYDRATE__: unknown;\n}\n\ntype InitialProps = {\n exp?: {\n notification?: any;\n manifestString?: string;\n [key: string]: any;\n };\n shell?: boolean;\n shellManifestUrl?: string;\n [key: string]: any;\n};\n\n// @needsAudit\n/**\n * Sets the initial React component to render natively in the app's root React Native view on Android, iOS, tvOS and the web.\n *\n * This method does the following:\n * - Invokes React Native's `AppRegistry.registerComponent`.\n * - Invokes React Native web's `AppRegistry.runApplication` on web to render to the root `index.html` file.\n * - Polyfills the `process.nextTick` function globally.\n *\n * This method also adds the following dev-only features that are removed in production bundles.\n * - Adds the Fast Refresh and bundle splitting indicator to the app.\n * - Asserts if the `expo-updates` package is misconfigured.\n * - Asserts if `react-native` is not aliased to `react-native-web` when running in the browser.\n * @param component The React component class that renders the rest of your app.\n * @see For information on how to setup `registerRootComponent` in an existing (bare) React Native app, see [Common questions](#rootregistercomponent-setup-for-existing-react-native-projects) below.\n */\nexport default function registerRootComponent<P extends InitialProps>(\n component: ComponentType<P>\n): void {\n let qualifiedComponent = component;\n\n if (process.env.NODE_ENV !== 'production') {\n const { withDevTools } = require('./withDevTools') as typeof import('./withDevTools');\n qualifiedComponent = withDevTools(component);\n }\n\n AppRegistry.registerComponent('main', () => qualifiedComponent);\n // Skip querying the DOM if we're in a Node.js environment.\n if (Platform.OS === 'web' && typeof window !== 'undefined') {\n const rootTag = document.getElementById('root');\n if (process.env.NODE_ENV !== 'production') {\n if (!rootTag) {\n throw new Error('Required HTML element with id \"root\" was not found in the document HTML.');\n }\n }\n\n AppRegistry.runApplication('main', {\n rootTag,\n // Injected by SSR HTML tags.\n hydrate: globalThis.__EXPO_ROUTER_HYDRATE__,\n });\n }\n}\n"],"mappings":"AAAA;AAAoB,OAAAA,WAAA;AAAA,OAAAC,QAAA;AAqCpB,eAAe,SAASC,qBAAqBA,CAC3CC,SAA2B,EACrB;EACN,IAAIC,kBAAkB,GAAGD,SAAS;EAElC,IAAIE,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,EAAE;IACzC,MAAM;MAAEC;IAAa,CAAC,GAAGC,OAAO,iBAAiB,CAAoC;IACrFL,kBAAkB,GAAGI,YAAY,CAACL,SAAS,CAAC;EAC9C;EAEAH,WAAW,CAACU,iBAAiB,CAAC,MAAM,EAAE,MAAMN,kBAAkB,CAAC;EAE/D,IAAIH,QAAQ,CAACU,EAAE,KAAK,KAAK,IAAI,OAAOC,MAAM,KAAK,WAAW,EAAE;IAC1D,MAAMC,OAAO,GAAGC,QAAQ,CAACC,cAAc,CAAC,MAAM,CAAC;IAC/C,IAAIV,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,EAAE;MACzC,IAAI,CAACM,OAAO,EAAE;QACZ,MAAM,IAAIG,KAAK,CAAC,0EAA0E,CAAC;MAC7F;IACF;IAEAhB,WAAW,CAACiB,cAAc,CAAC,MAAM,EAAE;MACjCJ,OAAO;MAEPK,OAAO,EAAEC,UAAU,CAACC;IACtB,CAAC,CAAC;EACJ;AACF","ignoreList":[]},"metadata":{"hasCjsExports":false},"sourceType":"module","externalDependencies":[]}