Next.js Discord

Discord Forum

What is the best ui decision to make timer component?

Unanswered
Asiatic Lion posted this in #help-forum
Open in Discord
Asiatic LionOP
I'm making marketplace website.

When you order something, you have 30 mins to pay the order.

I have a timer client component that shows how much time you have to pay the order.

The problem is there is noticeable delay before timer hydrates.

I can't set initial state on a server because it's gonna be hydration mismatch.

What's the best approach to make this timer component?

1 Reply

Store an expiration time in your db and use that to show the timer. Any delay in hydration shouldn't be a problem.