fix wrong parent in remove mutation

This commit is contained in:
Lukas Stabe 2023-01-23 17:50:35 +01:00
parent e961334ba7
commit 514599fbd9
1 changed files with 7 additions and 0 deletions

View File

@ -277,6 +277,13 @@ public final class FiberReconciler<Renderer: FiberRenderer> {
alternate is \(self.alternate.recursiveDescription)
current is \(current.recursiveDescription)
""")
// copy over elements to the alternate, so when an element is
// replaced, the old element can still be accessed to emit
// removal mutations for its children
walk(current) { node in
node.alternate?.element = node.element
return true
}
isReconciling = false