Send updated client-side storage values when hydrating (#1758)
This commit is contained in:
parent
2e014422f5
commit
393a7c6e2a
@ -25,7 +25,7 @@ export default function Component() {
|
|||||||
|
|
||||||
// Route after the initial page hydration.
|
// Route after the initial page hydration.
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const change_complete = () => Event([E('{{state_name}}.{{const.hydrate}}', {})])
|
const change_complete = () => Event(initialEvents.map((e) => ({...e})))
|
||||||
{{const.router}}.events.on('routeChangeComplete', change_complete)
|
{{const.router}}.events.on('routeChangeComplete', change_complete)
|
||||||
return () => {
|
return () => {
|
||||||
{{const.router}}.events.off('routeChangeComplete', change_complete)
|
{{const.router}}.events.off('routeChangeComplete', change_complete)
|
||||||
|
@ -33,6 +33,7 @@ DEFAULT_IMPORTS: imports.ImportDict = {
|
|||||||
},
|
},
|
||||||
"/utils/context.js": {
|
"/utils/context.js": {
|
||||||
ImportVar(tag="EventLoopContext"),
|
ImportVar(tag="EventLoopContext"),
|
||||||
|
ImportVar(tag="initialEvents"),
|
||||||
ImportVar(tag="StateContext"),
|
ImportVar(tag="StateContext"),
|
||||||
},
|
},
|
||||||
"": {ImportVar(tag="focus-visible/dist/focus-visible")},
|
"": {ImportVar(tag="focus-visible/dist/focus-visible")},
|
||||||
|
Loading…
Reference in New Issue
Block a user