Commit 1c5814b
docs(client): refine renderer-function teardown examples from PR review
Apply review feedback to the renderer-function teardown docs (PR #3585):
- view-helpers-api.md: rewrite the React 18 teardown example as an explicit
if/else (no double innerHTML read) and add an `if (!domNode) throw` guard so
a missing element yields a named-id error instead of a cryptic null deref;
add the same guard to the React 16/17 example.
- view-helpers-api.md: note that a dropped async teardown is logged via
console.error (diagnosable, not silent), matching the core ClientRenderer.
- render-functions.md: use react-dom/client's hydrateRoot (with import) to
match the view-helpers example instead of the invalid ReactDOM.hydrateRoot,
and clarify the LazyHydrate teardown is only registered after hydration runs.
Docs-only; no behavior change.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent bae8c50 commit 1c5814b
2 files changed
Lines changed: 20 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
125 | 130 | | |
126 | 131 | | |
127 | 132 | | |
| |||
137 | 142 | | |
138 | 143 | | |
139 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
140 | 149 | | |
141 | 150 | | |
142 | 151 | | |
143 | 152 | | |
144 | 153 | | |
145 | 154 | | |
146 | | - | |
| 155 | + | |
147 | 156 | | |
148 | 157 | | |
149 | 158 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| |||
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
45 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
46 | 50 | | |
47 | 51 | | |
48 | | - | |
| 52 | + | |
49 | 53 | | |
50 | 54 | | |
51 | 55 | | |
| |||
0 commit comments