Skip to content

Commit 2c709bb

Browse files
emw3ijjk
andauthored
Fixed syntax error in the example of React Hydration Error (vercel#32773)
## Documentation / Examples - [x] Make sure the linting passes by running `yarn lint` Co-authored-by: JJ Kasper <[email protected]>
1 parent 723caed commit 2c709bb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

errors/react-hydration-error.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ An example:
1414

1515
```jsx
1616
function MyComponent() {
17-
// This condition depends on `window`. During the first render of the browser the `color` variable will be different
18-
const color = typeof window !== 'undefined' ? 'red' : 'blue
19-
// As color is passed as a prop there is a mismatch between what was rendered server-side vs what was rendered in the first render
20-
return <h1 className={`title ${color}`}>Hello World!</h1>
17+
// This condition depends on `window`. During the first render of the browser the `color` variable will be different
18+
const color = typeof window !== 'undefined' ? 'red' : 'blue'
19+
// As color is passed as a prop there is a mismatch between what was rendered server-side vs what was rendered in the first render
20+
return <h1 className={`title ${color}`}>Hello World!</h1>
2121
}
2222
```
2323

0 commit comments

Comments
 (0)