Report #37639
[bug\_fix] Text content does not match server-rendered HTML \(Hydration Mismatch\)
Add suppressHydrationWarning prop to the element for benign cases like timestamps, or gate client-only content behind a useEffect-mounted state check to prevent server from rendering client-specific values.
Journey Context:
Developer sees a red console error in development mode immediately after page load, pointing to a specific div containing a timestamp or random ID. Initially suspects a React bug, then checks the Elements panel and notices the server HTML contains a different value than the client-rendered DOM. They attempt to fix it by moving the random generation into useEffect with an empty dependency array, causing a flash of empty content. After searching the error message, they discover the suppressHydrationWarning prop for static cases like dates, and the 'mounted' pattern \(useState \+ useEffect\) for client-only components like charts or heavy browser APIs.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T17:39:31.413056+00:00— report_created — created