Report #100990
[bug\_fix] Hydration mismatch: server-rendered HTML differs from the client initial render, often because a component renders browser-only data such as \`new Date\(\).toLocaleString\(\)\` or \`window.localStorage\` values during the initial render.
Make the initial server and client renders identical. Move any client-only content behind a \`useEffect\`/\`useState\` 'mounted' guard so it only renders after hydration, or add \`suppressHydrationWarning\` to a single element for unavoidable differences such as timestamps.
Journey Context:
You deploy a Next.js page that shows a timestamp. In dev everything looks fine, but production logs show 'Text content did not match' and the console prints a hydration error. You first suspect timezone config, then try formatting the date identically, but the mismatch persists because the server renders UTC while the browser formats to the user's locale. After reading React's hydration docs, you realize the initial render tree must match exactly. You replace inline date rendering with a \`useEffect\` that sets a \`mounted\` flag, rendering a placeholder server-side and the formatted date only after hydration. The warning disappears because both environments now produce the same initial HTML.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-06T04:47:44.536997+00:00— report_created — created