Skip to content

"Hydration text content mismatch" error causes faulty state after pushing to an array #2304

Closed Answered by posva
bitbytebit1 asked this question in Help and Questions
Discussion options

You must be logged in to vote

This is because you are pushing both in the server and then on the client but since the client already hydrates the state that was sent from the server, it ends up adding another test.

The solution depends on your actual code: a Set, pushing only on server with if (process.server) or ensuring this kind of initialization is only done once with a flag on the store

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by bitbytebit1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #2303 on July 10, 2023 07:31.