mirror of
https://github.com/status-im/react-native.git
synced 2025-02-28 17:10:50 +00:00
Fix detaching dropped views in Nodes
Summary: Groups had a crash when running with React with Nodes when returning from a search screen. This was due to the fact that the node representing a ShimmerFrameLayout was being dropped, and then later we were trying to detach it. Since the view was already dropped, we shouldn't try to detach it since it's already dropped and removed from the view hierarchy. Reviewed By: sriramramani Differential Revision: D3004541
This commit is contained in:
parent
0b560d3d3d
commit
45472fe400
@ -109,6 +109,13 @@ import com.facebook.react.uimanager.events.EventDispatcher;
|
||||
mOnLayoutEvents.clear();
|
||||
|
||||
if (!mViewsToDrop.isEmpty()) {
|
||||
for (int i = 0, mViewsToDropSize = mViewsToDrop.size(); i < mViewsToDropSize; i++) {
|
||||
// set parent tag to -1 to avoid trying to detach this view
|
||||
FlatShadowNode shadowNode = mViewsToDrop.get(i);
|
||||
if (shadowNode.mountsToView()) {
|
||||
shadowNode.setNativeParentTag(-1);
|
||||
}
|
||||
}
|
||||
mOperationsQueue.enqueueDropViews(collectViewTags(mViewsToDrop));
|
||||
mViewsToDrop.clear();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user