mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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:
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) {
|
||||
|
||||
Reference in New Issue
Block a user