Skip to content
Discussion options

You must be logged in to vote

@willy-dunamu well you need to understand that the initial state shouldn't be affected or modified, there's no thing like setting up the state before the initial render your component is render twice one on the server and one the client so keep that in mind. if you want to re-initialize your store with the data from the server you have two options: create the store with data or use useEffect to setup the initial data. BTW, keep in mind the rules and recommendations that we had in the nextjs guide, like you should create the store per request and you shouldn't use global stores.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@dbritto-dev
Comment options

Answer selected by willy-dunamu
@dbritto-dev
Comment options

@willy-dunamu
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants