react-native-macos/Libraries/Animated/nodes
Genki Kondo 40f4c662bc Set correct initial value for AnimatedComponent for styles backed by native animated nodes
Summary:
In AnimatedComponent.render, we get the initial values of any styles backed by AnimatedNode, but ONLY for non-native animations. Thus, if convert an animated node to native before the call to render to mount the component, we will end up not applying the initial value until after the component is mounted. This may result in a visible flicker as the expected value is applied some time after the component is mounted and visible.
- Without native driver: BaseViewManager.setTransform called during view preallocation (ViewManager.createViewInstance)
- With native driver: BaseViewManager.setTransform called during MountingManager.updateProps (called from PropsAnimatedNode.updateView)

This diff removes the isNative check in AnimatedStyle and AnimatedProps when traversing style props. This shouldn't be a problem:
- Created as non-native, animated with JS driver
  - This diff does not affect this scenario
- Created as non-native, animated with native driver
  - Initial value is applied correctly on render/mount. On subsequent renders, the outdated value from JS side will not apply on the platform view as it has not changed.
- Created as native, animated with native driver
  - Initial value is applied correctly on render/mount. On subsequent renders, the outdated value from JS side will not apply on the platform view as it has not changed.

Changelog:
[Internal][Fixed] - Set correct initial value for AnimatedComponent for styles backed by native animated nodes

Reviewed By: JoshuaGross, javache

Differential Revision: D36612758

fbshipit-source-id: 922d6534c605b3eb0a1d9476753111b726f138f2
2022-05-25 10:33:17 -07:00
..
AnimatedAddition.js Distinguish between string/number-valued interpolation nodes at the type level 2022-05-03 12:04:02 -07:00
AnimatedColor.js Correctly batch AnimatedColor updates 2022-05-23 07:57:42 -07:00
AnimatedDiffClamp.js Distinguish between string/number-valued interpolation nodes at the type level 2022-05-03 12:04:02 -07:00
AnimatedDivision.js Distinguish between string/number-valued interpolation nodes at the type level 2022-05-03 12:04:02 -07:00
AnimatedInterpolation.js Distinguish between string/number-valued interpolation nodes at the type level 2022-05-03 12:04:02 -07:00
AnimatedModulo.js Distinguish between string/number-valued interpolation nodes at the type level 2022-05-03 12:04:02 -07:00
AnimatedMultiplication.js Distinguish between string/number-valued interpolation nodes at the type level 2022-05-03 12:04:02 -07:00
AnimatedNode.js Fix JS animated node value updating when listener is attached 2022-02-02 19:56:43 -08:00
AnimatedProps.js Set correct initial value for AnimatedComponent for styles backed by native animated nodes 2022-05-25 10:33:17 -07:00
AnimatedStyle.js Set correct initial value for AnimatedComponent for styles backed by native animated nodes 2022-05-25 10:33:17 -07:00
AnimatedSubtraction.js Distinguish between string/number-valued interpolation nodes at the type level 2022-05-03 12:04:02 -07:00
AnimatedTracking.js Add platformConfig to native animations and nodes (#32736) 2022-01-19 19:45:21 -08:00
AnimatedTransform.js Add annotations to empty objects that look like indexers in Xplat 2022-05-03 19:59:28 -07:00
AnimatedValue.js Correctly batch AnimatedColor updates 2022-05-23 07:57:42 -07:00
AnimatedValueXY.js Add optional configs to constructors for AnimatedValue/ValueXY/Color 2022-05-20 10:42:40 -07:00
AnimatedWithChildren.js Add platformConfig to native animations and nodes (#32736) 2022-01-19 19:45:21 -08:00