hard20 pts · first answer countsreactssr
Hydration mismatch with time
A server-rendered React component shows the current time and the console reports a hydration mismatch. What is the cause and a correct fix?
export function LastUpdated() {
return <span>{new Date().toLocaleTimeString()}</span>
}Discussion 0
Join free to post in the discussion.
Related questions
- Keys for rows loaded from an APIFull Stack Developer
- Search shows results for old inputFull Stack Developer
- User bios rendered as HTMLFull Stack Developer
- Module variable holds the current userFull Stack Developer
- Why React lists need keysFrontend Developer
- Input that ignores typingFrontend Developer
- Changing a prop inside a childFrontend Developer
- Multiple setState callsFrontend Developer