repoweaver
Version:
A GitHub App that skillfully weaves multiple templates together to create and update repositories with intelligent merge strategies
1 lines • 2.74 kB
JSON
{"ast":null,"code":"\"use strict\";\n\nimport { nanoid } from 'nanoid/non-secure';\nimport * as React from 'react';\nimport { SingleNavigatorContext } from \"./EnsureSingleNavigator.js\";\nexport function useRegisterNavigator() {\n const [key] = React.useState(() => nanoid());\n const container = React.useContext(SingleNavigatorContext);\n if (container === undefined) {\n throw new Error(\"Couldn't register the navigator. Have you wrapped your app with 'NavigationContainer'?\\n\\nThis can also happen if there are multiple copies of '@react-navigation' packages installed.\");\n }\n React.useEffect(() => {\n const {\n register,\n unregister\n } = container;\n register(key);\n return () => unregister(key);\n }, [container, key]);\n return key;\n}","map":{"version":3,"names":["nanoid","React","SingleNavigatorContext","useRegisterNavigator","key","useState","container","useContext","undefined","Error","useEffect","register","unregister"],"sources":["/Users/pmouli/Documents/GitHub.nosync/boots-strapper/mobile/node_modules/@react-navigation/core/src/useRegisterNavigator.tsx"],"sourcesContent":["import { nanoid } from 'nanoid/non-secure';\nimport * as React from 'react';\n\nimport { SingleNavigatorContext } from './EnsureSingleNavigator';\n\n/**\n * Register a navigator in the parent context (either a navigation container or a screen).\n * This is used to prevent multiple navigators under a single container or screen.\n */\nexport function useRegisterNavigator() {\n const [key] = React.useState(() => nanoid());\n const container = React.useContext(SingleNavigatorContext);\n\n if (container === undefined) {\n throw new Error(\n \"Couldn't register the navigator. Have you wrapped your app with 'NavigationContainer'?\\n\\nThis can also happen if there are multiple copies of '@react-navigation' packages installed.\"\n );\n }\n\n React.useEffect(() => {\n const { register, unregister } = container;\n\n register(key);\n\n return () => unregister(key);\n }, [container, key]);\n\n return key;\n}\n"],"mappings":";;AAAA,SAASA,MAAM,QAAQ,mBAAmB;AAC1C,OAAO,KAAKC,KAAK,MAAM,OAAO;AAE9B,SAASC,sBAAsB;AAM/B,OAAO,SAASC,oBAAoBA,CAAA,EAAG;EACrC,MAAM,CAACC,GAAG,CAAC,GAAGH,KAAK,CAACI,QAAQ,CAAC,MAAML,MAAM,CAAC,CAAC,CAAC;EAC5C,MAAMM,SAAS,GAAGL,KAAK,CAACM,UAAU,CAACL,sBAAsB,CAAC;EAE1D,IAAII,SAAS,KAAKE,SAAS,EAAE;IAC3B,MAAM,IAAIC,KAAK,CACb,wLACF,CAAC;EACH;EAEAR,KAAK,CAACS,SAAS,CAAC,MAAM;IACpB,MAAM;MAAEC,QAAQ;MAAEC;IAAW,CAAC,GAAGN,SAAS;IAE1CK,QAAQ,CAACP,GAAG,CAAC;IAEb,OAAO,MAAMQ,UAAU,CAACR,GAAG,CAAC;EAC9B,CAAC,EAAE,CAACE,SAAS,EAAEF,GAAG,CAAC,CAAC;EAEpB,OAAOA,GAAG;AACZ","ignoreList":[]},"metadata":{"hasCjsExports":false},"sourceType":"module","externalDependencies":[]}