Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Commit

Permalink
Set parent in replaceVirtualNode too
Browse files Browse the repository at this point in the history
  • Loading branch information
ConorGriffin37 committed May 24, 2021
1 parent 4b69643 commit 3a12252
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/createReconciler.lua
Expand Up @@ -37,6 +37,7 @@ local function createReconciler(renderer)
local hostParent = virtualNode.hostParent
local hostKey = virtualNode.hostKey
local depth = virtualNode.depth
local parent = virtualNode.parent

-- If the node that is being replaced has modified context, we need to
-- use the original *unmodified* context for the new node
Expand All @@ -50,6 +51,7 @@ local function createReconciler(renderer)
-- mountVirtualNode can return nil if the element is a boolean
if newNode ~= nil then
newNode.depth = depth
newNode.parent = parent
end

return newNode
Expand Down

0 comments on commit 3a12252

Please sign in to comment.