@@ -7,22 +7,25 @@ import "@vitejs/plugin-rsc/browser-LizIyxet";
77import { rscStream } from "@vitejs/plugin-rsc/client-edAdk2GF" ;
88import React from "react" ;
99import ReactDomClient from "react-dom/client" ;
10- import { jsx } from "react/jsx-runtime" ;
1110import { BundlerContext } from 'navigation-react' ;
1211
13- //#region src/extra/browser.tsx
1412async function hydrate ( ) {
1513 const initialPayload = await createFromReadableStream ( rscStream ) ;
1614 function Shell ( ) {
1715 const [ payload , setPayload ] = React . useState ( initialPayload ) ;
1816 const bundler = React . useMemo ( ( ) => ( { setRoot : setPayload , deserialize : fetchRSC } ) , [ ] ) ;
19- return jsx ( BundlerContext . Provider , { value : bundler , children : payload . root } ) ;
17+ return (
18+ < React . StrictMode >
19+ < BundlerContext . Provider value = { bundler } >
20+ { payload . root }
21+ </ BundlerContext . Provider >
22+ </ React . StrictMode >
23+ ) ;
2024 }
21- const browserRoot = /* @__PURE__ */ jsx ( React . StrictMode , { children : /* @__PURE__ */ jsx ( Shell , { } ) } ) ;
22- ReactDomClient . hydrateRoot ( document , browserRoot ) ;
25+ ReactDomClient . hydrateRoot ( document , < Shell /> ) ;
2326}
24- async function fetchRSC ( request : any ) {
25- const payload = await createFromFetch ( fetch ( request ) ) ;
27+ async function fetchRSC ( url : string , options : any ) {
28+ const payload = await createFromFetch ( fetch ( url ) ) ;
2629 return payload . root ;
2730}
2831hydrate ( ) ;
0 commit comments