Skip to content

Commit 9a560ed

Browse files
committed
docs: fix heading IDs for CI
1 parent f7c624d commit 9a560ed

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/content/learn/render-and-commit.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,11 @@ export default function App() {
194194
</Sandpack>
195195

196196
This works because during this last step, React only updates the content of `<h1>` with the new `time`. It sees that the `<input>` appears in the JSX in the same place as last time, so React doesn't touch the `<input>`—or its `value`!
197-
## Debugging Hydration Mismatches
197+
## Debugging Hydration Mismatches {/*debugging-hydration-mismatches*/}
198198

199199
Hydration mismatches can occur when the HTML rendered on the server differs from what React renders on the client.
200200

201-
### Common causes
201+
### Common causes {/*common-causes*/}
202202

203203
- Non-deterministic values such as:
204204
- `Math.random()`
@@ -207,15 +207,15 @@ Hydration mismatches can occur when the HTML rendered on the server differs from
207207
- Differences between server and client environments
208208
- Asynchronous or inconsistent data
209209

210-
### Example
210+
### Example {/*example*/}
211211

212212
```jsx
213213
function App() {
214214
return <div>{Math.random()}</div>;
215215
}
216216
```
217217

218-
### How to fix
218+
### How to fix {/*how-to-fix*/}
219219
- Move non-deterministic logic into `useEffect`
220220
- Ensure consistent data between server and client
221221
- Guard browser-specific code:
@@ -225,13 +225,13 @@ if (typeof window !== "undefined") {
225225
}
226226
```
227227

228-
### Debugging checklist
228+
### Debugging checklist {/*debugging-checklist*/}
229229
- Is the output deterministic?
230230
- Is any browser-only API used during render?
231231
- Is server data identical to client data?
232232
- Are there time-based values?
233233

234-
### Best practices
234+
### Best practices {/*best-practices*/}
235235
- Keep rendering logic pure
236236
- Avoid side effects during render
237237
- Use client-only rendering when necessary

0 commit comments

Comments
 (0)