Skip to content
Open
Prev Previous commit
Next Next commit
docs(react-dom): avoid compiler annotation for hydration mismatch exa…
…mple
  • Loading branch information
yogayataverma committed Apr 26, 2026
commit e3bce84b45a2e6e93ce7c5bbb5a7ace46dc53304
6 changes: 4 additions & 2 deletions src/content/reference/react-dom/client/hydrateRoot.md
Original file line number Diff line number Diff line change
Expand Up @@ -552,10 +552,12 @@ Uncaught Error: Hydration failed because the server rendered HTML didn't match t

#### Example mismatch {/*example-mismatch*/}

Comment thread
yogayataverma marked this conversation as resolved.
```js {expectedErrors: {'react-compiler': [2]}}
```jsx
function App() {
return <div>{Math.random()}</div>;
const value = Math.random();
return <div>{value}</div>;
}
```

This renders a different value on the server and the client, so hydration fails.

Expand Down
Loading