Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,12 @@ ShadowNode::Shared UIManager::getNewestCloneOfShadowNode(
shadowNode.getSurfaceId(), [&](const ShadowTree& shadowTree) {
ancestorShadowNode = shadowTree.getCurrentRevision().rootShadowNode;
});
return getNewestCloneOfShadowNodeFromAncestor(shadowNode, ancestorShadowNode);
}

ShadowNode::Shared UIManager::getNewestCloneOfShadowNodeFromAncestor(
const ShadowNode& shadowNode,
const ShadowNode::Shared& ancestorShadowNode) const {
if (!ancestorShadowNode) {
return nullptr;
}
Expand Down Expand Up @@ -427,6 +432,8 @@ void UIManager::setNativeProps_DEPRECATED(
family.getSurfaceId(), [&](const ShadowTree& shadowTree) {
// The lambda passed to `commit` may be executed multiple times.
// We need to create fresh copy of the `RawProps` object each time.
auto ancestorShadowNode =
shadowTree.getCurrentRevision().rootShadowNode;
shadowTree.commit(
[&](RootShadowNode const& oldRootShadowNode) {
auto rootNode = oldRootShadowNode.cloneTree(
Expand All @@ -438,7 +445,9 @@ void UIManager::setNativeProps_DEPRECATED(
family.getSurfaceId(), *contextContainer_.get()};
auto props = componentDescriptor.cloneProps(
propsParserContext,
getNewestCloneOfShadowNode(*shadowNode)->getProps(),
getNewestCloneOfShadowNodeFromAncestor(
*shadowNode, ancestorShadowNode)
->getProps(),
RawProps(rawProps));

return oldShadowNode.clone({/* .props = */ props});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,10 @@ class UIManager final : public ShadowTreeDelegate {
const jsi::Value& successCallback,
const jsi::Value& failureCallback) const;

ShadowNode::Shared getNewestCloneOfShadowNodeFromAncestor(
const ShadowNode& shadowNode,
const ShadowNode::Shared& ancestorShadowNode) const;

SharedComponentDescriptorRegistry componentDescriptorRegistry_;
UIManagerDelegate* delegate_{};
UIManagerAnimationDelegate* animationDelegate_{nullptr};
Expand Down