Skip to content
Discussion options

You must be logged in to vote

I had a fruitful discussion regarding this issue in the Remix Discord chat. I'll be writing down what I learned here for others.

First off, in the const date = new Date() line directly in the component, the server's timezone is used first on the initial server render, and then the client's timezone is used on subsequent client renders. Because of this mismatch, a hydration error will likely occur if the server and client have different time zones.

The loaderDate is only generated with the server's timezone as expected. If a stable, timezone specific timestamp is required, the loader and action are probably the best places to generate it.

However if we need to support a requirement that ha…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by chunkily
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant