Skip to content

Commit 4de6220

Browse files
authored
Update entry.browser.tsx (#153)
1 parent 6e83668 commit 4de6220

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

unstable_rsc-vite/src/entry.browser.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
unstable_getRSCStream as getRSCStream,
1212
unstable_RSCHydratedRouter as RSCHydratedRouter,
1313
type unstable_RSCPayload as RSCServerPayload,
14+
type DataRouter,
1415
} from "react-router";
1516

1617
// Create and set the callServer function to support post-hydration server actions.
@@ -43,3 +44,9 @@ createFromReadableStream<RSCServerPayload>(getRSCStream()).then((payload) => {
4344
);
4445
});
4546
});
47+
48+
if (import.meta.hot) {
49+
import.meta.hot.on("rsc:update", () => {
50+
(window as unknown as { __router: DataRouter }).__router.revalidate();
51+
});
52+
}

0 commit comments

Comments
 (0)