mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-28 12:15:37 +08:00
Fabric: Implementing cloneAndReplaceChild() for ViewShadowNode
Summary: First, LayoutableShadowNode::cloneAndReplaceChild() is now pure virtual. The default implementation was useless and confusing. Second, cloneAndReplaceChild() is now fully implemented for ViewShadowNode, so fancy Yoga Concurrent layout *should* work now. Reviewed By: mdvacca Differential Revision: D7376352 fbshipit-source-id: 1199a37e64535c8592a2a5480e60139f61d02006
This commit is contained in:
committed by
Facebook Github Bot
parent
8f9212b839
commit
ee0cc6bbe7
@@ -93,9 +93,5 @@ void LayoutableShadowNode::layoutChildren(LayoutContext layoutContext) {
|
||||
// Default implementation does nothing.
|
||||
}
|
||||
|
||||
SharedLayoutableShadowNode LayoutableShadowNode::cloneAndReplaceChild(const SharedLayoutableShadowNode &child) {
|
||||
return child;
|
||||
}
|
||||
|
||||
} // namespace react
|
||||
} // namespace facebook
|
||||
|
||||
@@ -93,9 +93,8 @@ protected:
|
||||
/*
|
||||
* In case layout algorithm needs to mutate this (probably sealed) node,
|
||||
* it has to clone and replace it in the hierarchy before to do so.
|
||||
* Default implementation does nothing and returns `child`.
|
||||
*/
|
||||
virtual SharedLayoutableShadowNode cloneAndReplaceChild(const SharedLayoutableShadowNode &child);
|
||||
virtual SharedLayoutableShadowNode cloneAndReplaceChild(const SharedLayoutableShadowNode &child) = 0;
|
||||
|
||||
/*
|
||||
* Sets layout metrics for the shadow node.
|
||||
|
||||
Reference in New Issue
Block a user