Skip to content

Commit 2563ab5

Browse files
committed
Simplified to use fetch rsc
Now restructured the fetch rsc is in the index so can use to build the root
1 parent 8467c84 commit 2563ab5

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

NavigationReact/sample/rsc-webpack/src/index.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,7 @@ function Shell({data}) {
2828
);
2929
}
3030

31-
const root = await createFromFetch(
32-
fetch(window.location.pathname + window.location.search, {
33-
headers: {
34-
Accept: 'text/x-component',
35-
},
36-
})
37-
);
31+
const root = await fetchRSC(window.location.pathname + window.location.search);
3832

3933
ReactDOM.hydrateRoot(document, <Shell data={root} />);
4034

0 commit comments

Comments
 (0)