diff options
author | 2021-08-17 18:49:58 -0700 | |
---|---|---|
committer | 2021-08-17 18:49:58 -0700 | |
commit | bbe0a3d58ccb420fe94b8d59934b2b54ed71f295 (patch) | |
tree | cf65bb41ae3557df4ec6d48908deaa47b33f97ce /demos/hello-next/bun-framework-next/client.development.tsx | |
parent | 68b6e80b911439cecbc78d23fab3be82e77f2997 (diff) | |
parent | 7a1ca0bc0cb93f62daedfb4d5dee1bd22020a9d2 (diff) | |
download | bun-bbe0a3d58ccb420fe94b8d59934b2b54ed71f295.tar.gz bun-bbe0a3d58ccb420fe94b8d59934b2b54ed71f295.tar.zst bun-bbe0a3d58ccb420fe94b8d59934b2b54ed71f295.zip |
Merge branch 'main' of github.com:Jarred-Sumner/esdev
Former-commit-id: 7aec17b6232cb51067a289944aa733466c0478fb
Diffstat (limited to 'demos/hello-next/bun-framework-next/client.development.tsx')
-rw-r--r-- | demos/hello-next/bun-framework-next/client.development.tsx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/demos/hello-next/bun-framework-next/client.development.tsx b/demos/hello-next/bun-framework-next/client.development.tsx index d046751b2..c4346913d 100644 --- a/demos/hello-next/bun-framework-next/client.development.tsx +++ b/demos/hello-next/bun-framework-next/client.development.tsx @@ -1,3 +1,13 @@ +var onlyChildPolyfill = React.Children.only; +React.Children.only = function (children) { + if (children && typeof children === "object" && children.length == 1) { + return onlyChildPolyfill(children[0]); + } + + return onlyChildPolyfill(children); +}; + +globalThis.global = globalThis; import * as ReactDOM from "react-dom"; import App from "next/app"; import mitt, { MittEmitter } from "next/dist/shared/lib/mitt"; @@ -21,7 +31,7 @@ import { NEXT_DATA, ST, } from "next/dist/shared/lib/utils"; -import { Portal } from "next/dist/client/portal"; +// import { Portal } from "next/dist/client/portal"; import initHeadManager from "next/dist/client/head-manager"; import PageLoader, { StyleSheetTuple } from "next/dist/client/page-loader"; import measureWebVitals from "next/dist/client/performance-relayer"; @@ -187,7 +197,7 @@ let CachedComponent: React.ComponentType; function _boot(EntryPointNamespace) { const PageComponent = EntryPointNamespace.default; - + ReactDOM.hydrate( <Container fn={(error) => <div>{JSON.stringify(error)}</div>}> <App Component={PageComponent} pageProps={data.props}></App> |