Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/bump-internal-preact-10-29-1-12b794f.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@lynx-js/react": minor
---

Bump `@lynx-js/internal-preact` from `10.28.4-dfff9aa` to `10.29.1-20260424024911-12b794f` ([diff](https://github.com/lynx-family/internal-preact/compare/10.28.4-dfff9aa...10.29.1-20260424024911-12b794f)).

Fixes wrong DOM order when a keyed child moves to a different `$N` slot across a re-render. Cross-slot moves now land at the correct slot position instead of being appended past stable siblings.
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@
"build": "rslib build"
},
"dependencies": {
"preact": "npm:@lynx-js/internal-preact@10.28.4-dfff9aa"
"preact": "npm:@lynx-js/internal-preact@10.29.1-20260424024911-12b794f"
},
"devDependencies": {
"@lynx-js/types": "3.7.0",
Expand Down
8 changes: 7 additions & 1 deletion packages/react/runtime/src/snapshot/snapshot/snapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,13 @@ export class SnapshotInstance {
__RemoveElement(parent, newNode.__element_root!);
}
if (existingNode) {
if (__snapshot_def.isSlotV2 && newNode.__slotIndex < existingNode.__slotIndex) {
// SlotV2: each slot has its own wrapper. `existingNode` may live in a
// different wrapper — `insertBefore(node, ref)` across wrappers throws,
// so fall back to `append` (DOM auto-detaches the node from old parent).
if (
__snapshot_def.isSlotV2
&& newNode.__slotIndex !== existingNode.__slotIndex
) {
__AppendElement(parent, newNode.__element_root!);
} else {
__InsertElementBefore(
Expand Down
276 changes: 0 additions & 276 deletions packages/react/testing-library/src/__tests__/setState-jsx.test.jsx

This file was deleted.

Loading
Loading