repoweaver
Version:
A GitHub App that skillfully weaves multiple templates together to create and update repositories with intelligent merge strategies
1 lines • 4.1 kB
JSON
{"ast":null,"code":"\"use strict\";\n\nimport { CurrentRenderContext } from '@react-navigation/core';\nimport * as React from 'react';\nimport { ServerContext } from \"./ServerContext.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const ServerContainer = React.forwardRef(function ServerContainer({\n children,\n location\n}, ref) {\n React.useEffect(() => {\n console.error(\"'ServerContainer' should only be used on the server with 'react-dom/server' for SSR.\");\n }, []);\n const current = {};\n if (ref) {\n const value = {\n getCurrentOptions() {\n return current.options;\n }\n };\n if (typeof ref === 'function') {\n ref(value);\n } else {\n ref.current = value;\n }\n }\n return (_jsx(ServerContext.Provider, {\n value: {\n location\n },\n children: _jsx(CurrentRenderContext.Provider, {\n value: current,\n children: children\n })\n })\n );\n});","map":{"version":3,"names":["CurrentRenderContext","React","ServerContext","jsx","_jsx","ServerContainer","forwardRef","children","location","ref","useEffect","console","error","current","value","getCurrentOptions","options","Provider"],"sources":["/Users/pmouli/Documents/GitHub.nosync/boots-strapper/mobile/node_modules/@react-navigation/native/src/ServerContainer.tsx"],"sourcesContent":["import { CurrentRenderContext } from '@react-navigation/core';\nimport * as React from 'react';\n\nimport { ServerContext, type ServerContextType } from './ServerContext';\nimport type { ServerContainerRef } from './types';\n\ntype Props = ServerContextType & {\n children: React.ReactNode;\n};\n\n/**\n * Container component for server rendering.\n *\n * @param props.location Location object to base the initial URL for SSR.\n * @param props.children Child elements to render the content.\n * @param props.ref Ref object which contains helper methods.\n */\nexport const ServerContainer = React.forwardRef(function ServerContainer(\n { children, location }: Props,\n ref: React.Ref<ServerContainerRef>\n) {\n React.useEffect(() => {\n console.error(\n \"'ServerContainer' should only be used on the server with 'react-dom/server' for SSR.\"\n );\n }, []);\n\n // eslint-disable-next-line @eslint-react/no-unstable-context-value\n const current: { options?: object } = {};\n\n if (ref) {\n const value = {\n getCurrentOptions() {\n return current.options;\n },\n };\n\n // We write to the `ref` during render instead of `React.useImperativeHandle`\n // This is because `useImperativeHandle` will update the ref after 'commit',\n // and there's no 'commit' phase during SSR.\n // Mutating ref during render is unsafe in concurrent mode, but we don't care about it for SSR.\n if (typeof ref === 'function') {\n ref(value);\n } else {\n ref.current = value;\n }\n }\n\n return (\n // eslint-disable-next-line @eslint-react/no-unstable-context-value\n <ServerContext.Provider value={{ location }}>\n <CurrentRenderContext.Provider value={current}>\n {children}\n </CurrentRenderContext.Provider>\n </ServerContext.Provider>\n );\n});\n"],"mappings":";;AAAA,SAASA,oBAAoB,QAAQ,wBAAwB;AAC7D,OAAO,KAAKC,KAAK,MAAM,OAAO;AAE9B,SAASC,aAAa;AAAkD,SAAAC,GAAA,IAAAC,IAAA;AAcxE,OAAO,MAAMC,eAAe,GAAGJ,KAAK,CAACK,UAAU,CAAC,SAASD,eAAeA,CACtE;EAAEE,QAAQ;EAAEC;AAAgB,CAAC,EAC7BC,GAAkC,EAClC;EACAR,KAAK,CAACS,SAAS,CAAC,MAAM;IACpBC,OAAO,CAACC,KAAK,CACX,sFACF,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAGN,MAAMC,OAA6B,GAAG,CAAC,CAAC;EAExC,IAAIJ,GAAG,EAAE;IACP,MAAMK,KAAK,GAAG;MACZC,iBAAiBA,CAAA,EAAG;QAClB,OAAOF,OAAO,CAACG,OAAO;MACxB;IACF,CAAC;IAMD,IAAI,OAAOP,GAAG,KAAK,UAAU,EAAE;MAC7BA,GAAG,CAACK,KAAK,CAAC;IACZ,CAAC,MAAM;MACLL,GAAG,CAACI,OAAO,GAAGC,KAAK;IACrB;EACF;EAEA,QAEEV,IAAA,CAACF,aAAa,CAACe,QAAQ;MAACH,KAAK,EAAE;QAAEN;MAAS,CAAE;MAAAD,QAAA,EAC1CH,IAAA,CAACJ,oBAAoB,CAACiB,QAAQ;QAACH,KAAK,EAAED,OAAQ;QAAAN,QAAA,EAC3CA;MAAQ,CACoB;IAAC,CACV;EAAA;AAE5B,CAAC,CAAC","ignoreList":[]},"metadata":{"hasCjsExports":false},"sourceType":"module","externalDependencies":[]}