state asigned twice
Answered
Sun bear posted this in #help-forum
Sun bearOP
Answered by fuma
You are saying that you don’t want to run the
Just set the state in a
generateRandomSeen on the server right?Just set the state in a
useEffect, then it will only generated at the client side, run once only.10 Replies
Sun bearOP
i dont know how hydration works
how can i asign only once
when you open website it is different and then it changes again
You are saying that you don’t want to run the
Just set the state in a
generateRandomSeen on the server right?Just set the state in a
useEffect, then it will only generated at the client side, run once only.Answer
This can fix hydration errors
Nice to hear that! Mark it as the solution if it works 

@fuma Nice to hear that! Mark it as the solution if it works <a:meow_party:763131349698609173>
Sun bearOP
how can i mark and i will
Original message was deleted
See there