mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fix Android crash: mark re-created nodes in Differ
Summary: Android has some optimizations around view allocation and pre-allocation that, in the case of View Unflattening, can cause "Create" mutations to be skipped. To make sure that doesn't happen, we add a flag to ShadowViewMutation (in the core) that any platform can consume, that indicates if the mutation is a "recreation" mutation. It is still a bit unclear why this is needed, in the sense that I would expect props revision to increment if a view is unflattened. However, there is at least one documented reproduction where that is *not* the case. So for now, we'll have a hack pending further investigation. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D25935785 fbshipit-source-id: 6fb4f0a6dedba0fe46ba3cd558ac1daa70f671f5
This commit is contained in:
committed by
Facebook GitHub Bot
parent
a0403c0626
commit
bdea479a1f
@@ -553,7 +553,7 @@ void Binding::schedulerDidFinishTransaction(
|
||||
switch (mutationType) {
|
||||
case ShadowViewMutation::Create: {
|
||||
if (disablePreallocateViews_ ||
|
||||
newChildShadowView.props->revision > 1) {
|
||||
newChildShadowView.props->revision > 1 || mutation.recreated) {
|
||||
cppCommonMountItems.push_back(
|
||||
CppMountItem::CreateMountItem(newChildShadowView));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user