Client side state is not available in server side.
See original GitHub issueWhen the state is updated in getServerSideProps
or in getStaticProps
, the HYDRATE
action is called on client side to sync it with server side state, however the opposite is not happening. The server instance of the store always gets the initial state, not the client side state. What should be done in order to access client side state in getServerSideProps
to render the page based on that state ?
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Client side state is not hydrated from server on page reload
Server gets token via cookie and is authenticated; But when a new store is created on the client, it doesn't get the hydrated/updated...
Read more >State Management In ASP.NET - C# Corner
Server -Side State Management is different from Client-Side State Management but the operations and working is somewhat the same in functionality ...
Read more >Rather than using Session or view state, why don't we simply ...
Hi @BobDang-6703 , Session is used to store information required for a specific user session. The introduction of the Session object is to ......
Read more >What is State Management in ASP.NET? Applications, Types ...
Client -side state management refers to the technique of storing data on the client's browser in the form of either cookies or hidden...
Read more >Why view state is designed client side why not server side
View state is stored on client side ( HTML page in hidden fields ) not on server. i heared that there is a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@kyun server ALWAYS have default state by design. You can use cookies to authenticate users and some server middlewares to cache portions of state for clients. This lib has nothing to do with this though, it’s app responsibility.
It is completely out of scope of this package. You can sync state back to server by doing API calls and or using something like Yjs. Server state is only a seed to speed up client side initial rendering, nothing more. Documentation refers only to that initial rendering on client side when client state is indeed the same as server had.