Repository navigation
Commit 620ffd0
committed
fix(compiler): treat normalized empty JSXText as non-rendering in rendersChild
After normalizeAuthoredJsxLiterals collapses whitespace-only JSXText containing
linebreaks to '', the rendersChild function incorrectly treated the empty string
as a rendered child. This caused multiline empty hosts like <div ref={r}>\n</div>
to be marked as owning children, producing false OCTANE_STRONG_MANAGED_DOM_WRITE
diagnostics for textContent and child-list writes that the docs allow.
The fix adds an explicit empty-string check since '' is the normalized form of
whitespace-with-linebreak text and never renders content.1 parent ee3e9f1 commit 620ffd0
2 files changed
Lines changed: 15 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | | - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
158 | 160 | | |
159 | | - | |
| 161 | + | |
| 162 | + | |
160 | 163 | | |
161 | 164 | | |
162 | 165 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
315 | 325 | | |
316 | 326 | | |
317 | 327 | | |
| |||
0 commit comments