From d1b507a5c371f308d6c8e56acfe96c03e9922084 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Fri, 7 Aug 2020 08:35:06 -0700 Subject: [PATCH] Fix animation of PDP dismissal Summary: Changelog: [Internal] If animated component is managed by Fabric, prevent view flattening by setting nativeID. Reviewed By: shergin Differential Revision: D22998746 fbshipit-source-id: b9645537454f11fce3bb0e268db91219f5c6dc42 --- Libraries/Animated/src/createAnimatedComponent.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Libraries/Animated/src/createAnimatedComponent.js b/Libraries/Animated/src/createAnimatedComponent.js index aac34b767f7..29c0dbaba79 100644 --- a/Libraries/Animated/src/createAnimatedComponent.js +++ b/Libraries/Animated/src/createAnimatedComponent.js @@ -112,7 +112,6 @@ function createAnimatedComponent( }; _waitForUpdate = (): void => { - // If this works well on iOS, we should remove this check if (this._isFabric()) { if (this._animatedComponentId === -1) { this._animatedComponentId = animatedComponentNextId++; @@ -124,7 +123,6 @@ function createAnimatedComponent( }; _markUpdateComplete = (): void => { - // If this works well on iOS, we should remove this check if (this._isFabric()) { NativeAnimatedHelper.API.unsetWaitingForIdentifier( this._animatedComponentId, @@ -225,6 +223,7 @@ function createAnimatedComponent( {...passthruProps} style={mergedStyle} ref={this._setComponentRef} + nativeID={this._isFabric() ? 'animatedComponent' : undefined} // The native driver updates views directly through the UI thread so we // have to make sure the view doesn't get optimized away because it cannot // go through the NativeViewHierarchyManager since it operates on the shadow