mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-05 22:38:59 +08:00
Fabric: Introducing ShadowNode::shallowSourceNode()
Summary: The method replaces the current source node with its source node. It's useful when we have to clone some node but don't want to change a source node pointer. Reviewed By: fkgozali Differential Revision: D7503384 fbshipit-source-id: 81ec64079c7e99cb9abdda2af10d85281a94e1b1
This commit is contained in:
committed by
Facebook Github Bot
parent
5463fc260b
commit
db7f98b789
@@ -108,6 +108,10 @@ void ShadowNode::clearSourceNode() {
|
||||
sourceNode_.reset();
|
||||
}
|
||||
|
||||
void ShadowNode::shallowSourceNode() {
|
||||
sourceNode_ = sourceNode_.lock()->getSourceNode();
|
||||
}
|
||||
|
||||
#pragma mark - Equality
|
||||
|
||||
bool ShadowNode::operator==(const ShadowNode& rhs) const {
|
||||
|
||||
@@ -67,6 +67,14 @@ public:
|
||||
void replaceChild(const SharedShadowNode &oldChild, const SharedShadowNode &newChild);
|
||||
void clearSourceNode();
|
||||
|
||||
/*
|
||||
* Replaces the current source node with its source node.
|
||||
* This method might be used for illuminating side-effects caused by the last
|
||||
* cloning operation which are not desirable from the diffing algorithm
|
||||
* perspective.
|
||||
*/
|
||||
void shallowSourceNode();
|
||||
|
||||
#pragma mark - Equality
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user