mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Remove all layout index adjustments
Summary: Changelog: [Internal] # Context Timeline * ~March 2019 landed D14529038 (I'll be referring to this as "index adjustment fix") which attempted to fix a reproducible issue with layout animations: P127130177, see Spencer's diff for more context: D14245985 * May 2019 I realized that "index adjustment fix" has a bug in it and attempted to fix with D15485132, but was eventually reverted because of other crashes * Just recently have been getting tasks related to crashes that are attempting to either remove or add a view that is out of bounds which is caused by invalid index because of the "index adjustment fix". # What is this diff doing? I'm removing the "index adjustment fix" because I found that the original layout animation repro, P127130177, no longer repros on latest master with the "index adjustment fix" reverted. Additionally, I've found a consistent crash in (RN bookmark > Sample Integration App > Relay Sample Friends) of a bad view deletion because of the "index adjustment fix" Removing the index adjustment fix may have effects elsewhere but it seems better to remove this and go back to what layout animations was doing a year ago than to continue on in this half-baked state. Reviewed By: JoshuaGross Differential Revision: D20323928 fbshipit-source-id: ba4a222915add00e98a9936ba2a8efc4006fb8e3
This commit is contained in:
committed by
Facebook Github Bot
parent
42c1957aff
commit
d3b93f7578
@@ -333,7 +333,6 @@ public class UIImplementation {
|
||||
int[] indicesToRemove = new int[numToMove + numToRemove];
|
||||
int[] tagsToRemove = new int[indicesToRemove.length];
|
||||
int[] tagsToDelete = new int[numToRemove];
|
||||
int[] indicesToDelete = new int[numToRemove];
|
||||
|
||||
if (numToMove > 0) {
|
||||
Assertions.assertNotNull(moveFrom);
|
||||
@@ -365,7 +364,6 @@ public class UIImplementation {
|
||||
indicesToRemove[numToMove + i] = indexToRemove;
|
||||
tagsToRemove[numToMove + i] = tagToRemove;
|
||||
tagsToDelete[i] = tagToRemove;
|
||||
indicesToDelete[i] = indexToRemove;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -405,12 +403,7 @@ public class UIImplementation {
|
||||
}
|
||||
|
||||
mNativeViewHierarchyOptimizer.handleManageChildren(
|
||||
cssNodeToManage,
|
||||
indicesToRemove,
|
||||
tagsToRemove,
|
||||
viewsToAdd,
|
||||
tagsToDelete,
|
||||
indicesToDelete);
|
||||
cssNodeToManage, indicesToRemove, tagsToRemove, viewsToAdd, tagsToDelete);
|
||||
|
||||
for (int i = 0; i < tagsToDelete.length; i++) {
|
||||
removeShadowNode(mShadowNodeRegistry.getNode(tagsToDelete[i]));
|
||||
|
||||
Reference in New Issue
Block a user