mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Do not check consistency of updated Virtual views
Summary: This impacts Android only. It's not high-impact to check the consistency of these views and they can become "inconsistent" easily in a way that is not interesting or useful to us, since we handle "virtual" views differently on the platform. The need for these hacks should go away in the future if/when we account for virtual views in the differ, and stop sending redundant instructions entirely. Changelog: [Internal] Reviewed By: sammy-SC Differential Revision: D27407779 fbshipit-source-id: 01a7ea5106ed5d94b908de03a6a710cc6275018d
This commit is contained in:
1 parent
f915ca99be
commit
4ae1a9bea8
1 file changed
+12
-6
@@ -93,6 +93,10 @@ void StubViewTree::mutate(ShadowViewMutationList const &mutations) {
|
||||
childStubView->parentTag = parentTag;
|
||||
parentStubView->children.insert(
|
||||
parentStubView->children.begin() + mutation.index, childStubView);
|
||||
} else {
|
||||
auto childTag = mutation.newChildShadowView.tag;
|
||||
auto childStubView = registry[childTag];
|
||||
childStubView->update(mutation.newChildShadowView);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -151,13 +155,15 @@ void StubViewTree::mutate(ShadowViewMutationList const &mutations) {
|
||||
registry.find(mutation.newChildShadowView.tag) != registry.end());
|
||||
auto oldStubView = registry[mutation.newChildShadowView.tag];
|
||||
react_native_assert(oldStubView->tag != 0);
|
||||
if ((ShadowView)(*oldStubView) != mutation.oldChildShadowView) {
|
||||
LOG(ERROR)
|
||||
<< "UPDATE mutation assertion failure: oldChildShadowView doesn't match oldStubView: ["
|
||||
<< mutation.oldChildShadowView.tag << "]";
|
||||
if (!mutation.mutatedViewIsVirtual()) {
|
||||
if ((ShadowView)(*oldStubView) != mutation.oldChildShadowView) {
|
||||
LOG(ERROR)
|
||||
<< "UPDATE mutation assertion failure: oldChildShadowView doesn't match oldStubView: ["
|
||||
<< mutation.oldChildShadowView.tag << "]";
|
||||
}
|
||||
react_native_assert(
|
||||
(ShadowView)(*oldStubView) == mutation.oldChildShadowView);
|
||||
}
|
||||
react_native_assert(
|
||||
(ShadowView)(*oldStubView) == mutation.oldChildShadowView);
|
||||
oldStubView->update(mutation.newChildShadowView);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user