mirror of
https://github.com/status-im/react-native.git
synced 2025-02-23 14:48:25 +00:00
Fabric: ShadowTree::getRootShadowNode
was removed
Summary: Because it was not idiomatic anyway. There is no point having a pointer to RootShadowNode without any guarantees that it's the current one. Using `commit` method makes this concern explicit. Reviewed By: sahrens Differential Revision: D13615363 fbshipit-source-id: f71ffc3c55dbdc69624933eb8b92334ed793c794
This commit is contained in:
parent
84cf657308
commit
9f71a8f26e
@ -50,11 +50,6 @@ Tag ShadowTree::getSurfaceId() const {
|
||||
return surfaceId_;
|
||||
}
|
||||
|
||||
SharedRootShadowNode ShadowTree::getRootShadowNode() const {
|
||||
std::shared_lock<folly::SharedMutex> lock(commitMutex_);
|
||||
return rootShadowNode_;
|
||||
}
|
||||
|
||||
bool ShadowTree::commit(
|
||||
std::function<UnsharedRootShadowNode(
|
||||
const SharedRootShadowNode &oldRootShadowNode)> transaction,
|
||||
|
@ -54,11 +54,6 @@ class ShadowTree final {
|
||||
int attempts = 1,
|
||||
int *revision = nullptr) const;
|
||||
|
||||
/*
|
||||
* Returns a root shadow node that represents the last committed three.
|
||||
*/
|
||||
SharedRootShadowNode getRootShadowNode() const;
|
||||
|
||||
#pragma mark - Delegate
|
||||
|
||||
/*
|
||||
|
@ -100,7 +100,10 @@ LayoutMetrics UIManager::getRelativeLayoutMetrics(
|
||||
if (!ancestorShadowNode) {
|
||||
shadowTreeRegistry_->visit(
|
||||
shadowNode.getRootTag(), [&](const ShadowTree &shadowTree) {
|
||||
ancestorShadowNode = shadowTree.getRootShadowNode().get();
|
||||
shadowTree.commit([&](const SharedRootShadowNode &oldRootShadowNode) {
|
||||
ancestorShadowNode = oldRootShadowNode.get();
|
||||
return nullptr;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user