Next.js Discord

Discord Forum

Countdown is causing hydration error? How to ignore it?

Answered
Dutch posted this in #help-forum
Open in Discord
Avatar
DutchOP
I have a Countdown component which counts down by seconds from a given date. This component is causing an hydration error, since on the server it's sometimes displays 1 seconds earlier.

I don't want to display zeros or hide the countdown until it's hydrated. It's a better user experience to show some numbers immediately. Can I remove hydration or add some kind of flag "expect hydration error"?

5 Replies

Answer
Avatar
DutchOP
That worked, thank you so much!
Avatar
yr welcome! plz mark solution to close the thread 🙂
⬆️
Avatar
DutchOP
Done