You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to have an app with a single proper Store (so, components are almost stateless), but still use SSR to speed up serving and take care of SEO.
I inversion this working as follows:
When user initially opens the page - for simplicity, createRouteData of each page returns an object with a signature identical to the Store, that object becomes initial state of the Store.
User can interact with the page - like with a normal Store-baed app.
If user triggers refetchRouteData() - a new object received from the server is merged into the Store. alternatively for the future, a custom merging function is provided for initial store creation / refetching.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'd like to have an app with a single proper Store (so, components are almost stateless), but still use SSR to speed up serving and take care of SEO.
I inversion this working as follows:
When user initially opens the page - for simplicity,
createRouteData
of each page returns an object with a signature identical to theStore
, that object becomes initial state of theStore
.User can interact with the page - like with a normal
Store
-baed app.If user triggers
refetchRouteData()
- a new object received from the server is merged into theStore
.alternatively for the future, a custom merging function is provided for initial store creation / refetching.
According to the docs
Is it possible to somehow tap into that
Store
, or wirecreateRouteData
into an existing one?Beta Was this translation helpful? Give feedback.
All reactions