Revert D17201061: [RN][Fabric] Always use forceUpdate for Fabric JS animations

Differential Revision:
D17201061

Original commit changeset: c43b59913d82

fbshipit-source-id: 470e3fcddafceb0677585c0a1f482120b97e8d2a
This commit is contained in:
Eli White
2019-09-06 21:33:32 -07:00
committed by Facebook Github Bot
parent e8541e03f4
commit 16256f83f8
@@ -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) {