Skip to content

Commit

Permalink
fix: copy state in reanimated commit hook (#5934)
Browse files Browse the repository at this point in the history
## Summary

Fix for the issue: Expensify/App#40048 which
root cause of seems to be the not copied state of `ScrollView` when this
code is not added. I'll try to provide a simple repro when I get some
time to do it.

## Test plan
  • Loading branch information
WoLewicki authored Apr 25, 2024
1 parent 28618e4 commit 7c45f81
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Common/cpp/Fabric/ShadowTreeCloner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ShadowNode::Unshared cloneShadowTreeWithNewProps(
const auto props = source->getComponentDescriptor().cloneProps(
propsParserContext, source->getProps(), std::move(rawProps));

auto newChildNode = source->clone({/* .props = */ props});
auto newChildNode = source->clone({/* .props = */ props, ShadowNodeFragment::childrenPlaceholder(), source->getState()});

for (auto it = ancestors.rbegin(); it != ancestors.rend(); ++it) {
auto &parentNode = it->first.get();
Expand All @@ -53,6 +53,7 @@ ShadowNode::Unshared cloneShadowTreeWithNewProps(
newChildNode = parentNode.clone({
ShadowNodeFragment::propsPlaceholder(),
std::make_shared<ShadowNode::ListOfShared>(children),
parentNode.getState()
});
}

Expand Down

0 comments on commit 7c45f81

Please sign in to comment.