repoweaver
Version:
A GitHub App that skillfully weaves multiple templates together to create and update repositories with intelligent merge strategies
1 lines • 4.24 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 var ServerContainer = React.forwardRef(function ServerContainer(_ref, ref) {\n var children = _ref.children,\n location = _ref.location;\n React.useEffect(function () {\n console.error(\"'ServerContainer' should only be used on the server with 'react-dom/server' for SSR.\");\n }, []);\n var current = {};\n if (ref) {\n var value = {\n getCurrentOptions: function 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: 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","_ref","ref","children","location","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,IAAMC,eAAe,GAAGJ,KAAK,CAACK,UAAU,CAAC,SAASD,eAAeA,CAAAE,IAAA,EAEtEC,GAAkC,EAClC;EAAA,IAFEC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;IAAEC,QAAA,GAAAH,IAAA,CAAAG,QAAA;EAGZT,KAAK,CAACU,SAAS,CAAC,YAAM;IACpBC,OAAO,CAACC,KAAK,CACX,sFACF,CAAC;EACH,CAAC,EAAE,EAAE,CAAC;EAGN,IAAMC,OAA6B,GAAG,CAAC,CAAC;EAExC,IAAIN,GAAG,EAAE;IACP,IAAMO,KAAK,GAAG;MACZC,iBAAiB,WAAjBA,iBAAiBA,CAAA,EAAG;QAClB,OAAOF,OAAO,CAACG,OAAO;MACxB;IACF,CAAC;IAMD,IAAI,OAAOT,GAAG,KAAK,UAAU,EAAE;MAC7BA,GAAG,CAACO,KAAK,CAAC;IACZ,CAAC,MAAM;MACLP,GAAG,CAACM,OAAO,GAAGC,KAAK;IACrB;EACF;EAEA,QAEEX,IAAA,CAACF,aAAa,CAACgB,QAAQ;MAACH,KAAK,EAAE;QAAEL,QAAA,EAAAA;MAAS,CAAE;MAAAD,QAAA,EAC1CL,IAAA,CAACJ,oBAAoB,CAACkB,QAAQ;QAACH,KAAK,EAAED,OAAQ;QAAAL,QAAA,EAC3CA;MAAQ,CACoB;IAAC,CACV;EAAA;AAE5B,CAAC,CAAC","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}