Skip to content
Snippets Groups Projects

Fixed Hydration Error from Clock due to Mismatched Server and Client HTML

Merged Chris Yang requested to merge chris/73-fix-clock-hydration into main

Fixes this bug: image

The above is caused by calling Date() on the server when the variable is declared, which causes a mismatch between the timestamps by the time it gets to the client. The HTML can only be modified once it gets to the client, so the state must be empty until useEffect() runs.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading