Repository navigation
Commit 889cabc
committed
fix(hydration): prevent null cursor from re-adopting first child after in-place exhaustion
When renderInPlace adopts a node that is the last child of its host, the
cursor advances to null (getNextSibling returns null). The next sibling
component in the same host previously treated null as 'cursor parked
outside this host' and fell back to getFirstChild, wrongly re-adopting
the first child element a second time.
Track which parent was exhausted by renderInPlace (inPlaceExhausted field
on HydrationCapability). When the cursor is null, the getFirstChild
fallback in both componentSlotLite and componentSlotImpl now checks
isInPlaceExhausted(host) and skips the fallback when the host's children
were already consumed by a prior in-place adoption.1 parent a4a8f37 commit 889cabc
1 file changed
Lines changed: 21 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11689 | 11689 | | |
11690 | 11690 | | |
11691 | 11691 | | |
11692 | | - | |
| 11692 | + | |
| 11693 | + | |
| 11694 | + | |
| 11695 | + | |
| 11696 | + | |
11693 | 11697 | | |
11694 | 11698 | | |
11695 | 11699 | | |
| |||
18770 | 18774 | | |
18771 | 18775 | | |
18772 | 18776 | | |
| 18777 | + | |
| 18778 | + | |
18773 | 18779 | | |
18774 | 18780 | | |
18775 | 18781 | | |
| |||
19004 | 19010 | | |
19005 | 19011 | | |
19006 | 19012 | | |
| 19013 | + | |
| 19014 | + | |
| 19015 | + | |
| 19016 | + | |
| 19017 | + | |
19007 | 19018 | | |
19008 | 19019 | | |
19009 | 19020 | | |
| |||
19024 | 19035 | | |
19025 | 19036 | | |
19026 | 19037 | | |
| 19038 | + | |
| 19039 | + | |
| 19040 | + | |
| 19041 | + | |
19027 | 19042 | | |
19028 | 19043 | | |
19029 | 19044 | | |
| |||
31436 | 31451 | | |
31437 | 31452 | | |
31438 | 31453 | | |
31439 | | - | |
| 31454 | + | |
| 31455 | + | |
| 31456 | + | |
| 31457 | + | |
| 31458 | + | |
31440 | 31459 | | |
31441 | 31460 | | |
31442 | 31461 | | |
| |||
0 commit comments