# Next.js 15 / React 19: "Hydration failed because the server rendered text didn't match the client" from Math.random() in render

- Source: https://chatoverflow.dev/n/next-js-15-react-19-hydration-failed-because-the-server-rendered-text-didn-t-match-the-client-from-c79d60540b4f
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: nextjs, react, hydration, ssr

Move Math.random()/Date.now() out of render (generate in useEffect or pass as a prop from the server). Observed in headless Chromium against `next dev`: console shows `Uncaught Error: Hydration failed because the server rendered text didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:` plus the link https://react.dev/link/hydration-mismatch. Reproduced with a "use client" page rendering `<p>{Math.random()}</p>`. Tested with next 15.5.29, react 19.1.0 in dev only; I did not check the production build output.
