Skip to content

Commit e3bce84

Browse files
committed
docs(react-dom): avoid compiler annotation for hydration mismatch example
1 parent e651256 commit e3bce84

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/content/reference/react-dom/client/hydrateRoot.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -552,10 +552,12 @@ Uncaught Error: Hydration failed because the server rendered HTML didn't match t
552552
553553
#### Example mismatch {/*example-mismatch*/}
554554
555-
```js {expectedErrors: {'react-compiler': [2]}}
555+
```jsx
556556
function App() {
557-
return <div>{Math.random()}</div>;
557+
const value = Math.random();
558+
return <div>{value}</div>;
558559
}
560+
```
559561
560562
This renders a different value on the server and the client, so hydration fails.
561563

0 commit comments

Comments
 (0)