Skip to content

Commit

Permalink
Merge pull request #41101 from software-mansion-labs/@wolewicki/copy-…
Browse files Browse the repository at this point in the history
…state-in-rn

feat: make rn core copy the state on cloning the shadow tree
  • Loading branch information
AndrewGable authored May 13, 2024
2 parents 84e925a + 1909054 commit 89489c8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions patches/react-native+0.73.4+015+copyStateOnClone.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/node_modules/react-native/ReactCommon/react/renderer/core/ShadowNode.cpp b/node_modules/react-native/ReactCommon/react/renderer/core/ShadowNode.cpp
index 641b6d2..6adeb1b 100644
--- a/node_modules/react-native/ReactCommon/react/renderer/core/ShadowNode.cpp
+++ b/node_modules/react-native/ReactCommon/react/renderer/core/ShadowNode.cpp
@@ -331,6 +331,7 @@ ShadowNode::Unshared ShadowNode::cloneTree(
childNode = parentNode.clone({
ShadowNodeFragment::propsPlaceholder(),
std::make_shared<ShadowNode::ListOfShared>(children),
+ parentNode.getState(),
});
}

0 comments on commit 89489c8

Please sign in to comment.