repoweaver
Version:
A GitHub App that skillfully weaves multiple templates together to create and update repositories with intelligent merge strategies
1 lines • 4.09 kB
JSON
{"ast":null,"code":"\"use strict\";\n\nimport * as React from 'react';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst MULTIPLE_NAVIGATOR_ERROR = `Another navigator is already registered for this container. You likely have multiple navigators under a single \"NavigationContainer\" or \"Screen\". Make sure each navigator is under a separate \"Screen\" container. See https://reactnavigation.org/docs/nesting-navigators for a guide on nesting.`;\nexport const SingleNavigatorContext = React.createContext(undefined);\nexport function EnsureSingleNavigator({\n children\n}) {\n const navigatorKeyRef = React.useRef(undefined);\n const value = React.useMemo(() => ({\n register(key) {\n const currentKey = navigatorKeyRef.current;\n if (currentKey !== undefined && key !== currentKey) {\n throw new Error(MULTIPLE_NAVIGATOR_ERROR);\n }\n navigatorKeyRef.current = key;\n },\n unregister(key) {\n const currentKey = navigatorKeyRef.current;\n if (key !== currentKey) {\n return;\n }\n navigatorKeyRef.current = undefined;\n }\n }), []);\n return _jsx(SingleNavigatorContext.Provider, {\n value: value,\n children: children\n });\n}","map":{"version":3,"names":["React","jsx","_jsx","MULTIPLE_NAVIGATOR_ERROR","SingleNavigatorContext","createContext","undefined","EnsureSingleNavigator","children","navigatorKeyRef","useRef","value","useMemo","register","key","currentKey","current","Error","unregister","Provider"],"sources":["/Users/pmouli/Documents/GitHub.nosync/boots-strapper/mobile/node_modules/@react-navigation/core/src/EnsureSingleNavigator.tsx"],"sourcesContent":["import * as React from 'react';\n\ntype Props = {\n children: React.ReactNode;\n};\n\nconst MULTIPLE_NAVIGATOR_ERROR = `Another navigator is already registered for this container. You likely have multiple navigators under a single \"NavigationContainer\" or \"Screen\". Make sure each navigator is under a separate \"Screen\" container. See https://reactnavigation.org/docs/nesting-navigators for a guide on nesting.`;\n\nexport const SingleNavigatorContext = React.createContext<\n | {\n register(key: string): void;\n unregister(key: string): void;\n }\n | undefined\n>(undefined);\n\n/**\n * Component which ensures that there's only one navigator nested under it.\n */\nexport function EnsureSingleNavigator({ children }: Props) {\n const navigatorKeyRef = React.useRef<string | undefined>(undefined);\n\n const value = React.useMemo(\n () => ({\n register(key: string) {\n const currentKey = navigatorKeyRef.current;\n\n if (currentKey !== undefined && key !== currentKey) {\n throw new Error(MULTIPLE_NAVIGATOR_ERROR);\n }\n\n navigatorKeyRef.current = key;\n },\n unregister(key: string) {\n const currentKey = navigatorKeyRef.current;\n\n if (key !== currentKey) {\n return;\n }\n\n navigatorKeyRef.current = undefined;\n },\n }),\n []\n );\n\n return (\n <SingleNavigatorContext.Provider value={value}>\n {children}\n </SingleNavigatorContext.Provider>\n );\n}\n"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAM/B,MAAMC,wBAAwB,GAAG,oSAAoS;AAErU,OAAO,MAAMC,sBAAsB,GAAGJ,KAAK,CAACK,aAAa,CAMvDC,SAAS,CAAC;AAKZ,OAAO,SAASC,qBAAqBA,CAAC;EAAEC;AAAgB,CAAC,EAAE;EACzD,MAAMC,eAAe,GAAGT,KAAK,CAACU,MAAM,CAAqBJ,SAAS,CAAC;EAEnE,MAAMK,KAAK,GAAGX,KAAK,CAACY,OAAO,CACzB,OAAO;IACLC,QAAQA,CAACC,GAAW,EAAE;MACpB,MAAMC,UAAU,GAAGN,eAAe,CAACO,OAAO;MAE1C,IAAID,UAAU,KAAKT,SAAS,IAAIQ,GAAG,KAAKC,UAAU,EAAE;QAClD,MAAM,IAAIE,KAAK,CAACd,wBAAwB,CAAC;MAC3C;MAEAM,eAAe,CAACO,OAAO,GAAGF,GAAG;IAC/B,CAAC;IACDI,UAAUA,CAACJ,GAAW,EAAE;MACtB,MAAMC,UAAU,GAAGN,eAAe,CAACO,OAAO;MAE1C,IAAIF,GAAG,KAAKC,UAAU,EAAE;QACtB;MACF;MAEAN,eAAe,CAACO,OAAO,GAAGV,SAAS;IACrC;EACF,CAAC,CAAC,EACF,EACF,CAAC;EAED,OACEJ,IAAA,CAACE,sBAAsB,CAACe,QAAQ;IAACR,KAAK,EAAEA,KAAM;IAAAH,QAAA,EAC3CA;EAAQ,CACsB,CAAC;AAEtC","ignoreList":[]},"metadata":{"hasCjsExports":false},"sourceType":"module","externalDependencies":[]}