From 16256f83f836a12114b67dcfb7e2b9aceb42fade Mon Sep 17 00:00:00 2001 From: Eli White Date: Fri, 6 Sep 2019 21:31:44 -0700 Subject: [PATCH] Revert D17201061: [RN][Fabric] Always use `forceUpdate` for Fabric JS animations Differential Revision: D17201061 Original commit changeset: c43b59913d82 fbshipit-source-id: 470e3fcddafceb0677585c0a1f482120b97e8d2a --- Libraries/Animated/src/createAnimatedComponent.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/Libraries/Animated/src/createAnimatedComponent.js b/Libraries/Animated/src/createAnimatedComponent.js index bba12af0ef9..a6013a716f6 100644 --- a/Libraries/Animated/src/createAnimatedComponent.js +++ b/Libraries/Animated/src/createAnimatedComponent.js @@ -87,9 +87,6 @@ function createAnimatedComponent(Component: any, defaultProps: any): any { // components. If you want to animate a composite component, you need to // re-render it. In this case, we have a fallback that uses forceUpdate. _animatedPropsCallback = () => { - // eslint-disable-next-line dot-notation - const internalInstanceHandle = this._component['_internalInstanceHandle']; - if (this._component == null) { // AnimatedProps is created in will-mount because it's used in render. // But this callback may be invoked before mount in async mode, @@ -99,12 +96,7 @@ function createAnimatedComponent(Component: any, defaultProps: any): any { this._invokeAnimatedPropsCallbackOnMount = true; } else if ( AnimatedComponent.__skipSetNativeProps_FOR_TESTS_ONLY || - // For animating properties of non-leaf/non-native components - typeof this._component.setNativeProps !== 'function' || - // This forces all animations to go through forceUpdate, and skip setNativeProps, in Fabric - (internalInstanceHandle && - internalInstanceHandle.stateNode && - internalInstanceHandle.stateNode.canonical != null) + typeof this._component.setNativeProps !== 'function' ) { this.forceUpdate(); } else if (!this._propsAnimated.__isNative) {