mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Introduce "Sealing" of ReactShadowNodes
Summary: This diff introduces the concept of "Seal" ReactShadowNodes. This new field will be used to guarantee immutability of commited ReactShodow Nodes. Reviewed By: fkgozali Differential Revision: D8552709 fbshipit-source-id: dfd95730f10341af0dd762f8a8aa186563cf33e9
This commit is contained in:
committed by
Facebook Github Bot
parent
f19c36116c
commit
001e217f33
@@ -128,6 +128,7 @@ public class ReactShadowNodeImpl implements ReactShadowNode<ReactShadowNodeImpl>
|
||||
|
||||
private @Nullable ReactStylesDiffMap mNewProps;
|
||||
private long mInstanceHandle;
|
||||
private boolean mIsSealed = false;
|
||||
|
||||
public ReactShadowNodeImpl() {
|
||||
mDefaultPadding = new Spacing(0);
|
||||
@@ -164,6 +165,7 @@ public class ReactShadowNodeImpl implements ReactShadowNode<ReactShadowNodeImpl>
|
||||
mNewProps = null;
|
||||
mParent = null;
|
||||
mOriginalReactShadowNode = original;
|
||||
mIsSealed = false;
|
||||
}
|
||||
|
||||
private void replaceChild(ReactShadowNodeImpl newNode, int childIndex) {
|
||||
@@ -1147,4 +1149,14 @@ public class ReactShadowNodeImpl implements ReactShadowNode<ReactShadowNodeImpl>
|
||||
public void setInstanceHandle(long instanceHandle) {
|
||||
mInstanceHandle = instanceHandle;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void markAsSealed() {
|
||||
mIsSealed = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSealed() {
|
||||
return mIsSealed;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user