Skip to content

Commit c76173c

Browse files
committed
only hydrate on client if initial state is available
1 parent a96cea5 commit c76173c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/entry-client.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ import { app, store, router } from './app'
33

44
// prime the store with server-initialized state.
55
// the state is determined during SSR and inlined in the page markup.
6-
store.replaceState(window.__INITIAL_STATE__)
6+
if (window.__INITIAL_STATE__) {
7+
store.replaceState(window.__INITIAL_STATE__)
8+
}
79

810
// wait until router has resolved all async before hooks
911
// and async components...

0 commit comments

Comments
 (0)