686ab49107
Summary: There are some cases where restoring default values on component unmount is not desirable. For example in react-native-screens we want to keep the native view displayed after react has unmounted them. Restoring default values causes an issue there because it will change props controlled my native animated back to their default value instead of keeping whatever value they had been animated to. Restoring default values is only needed for updates anyway, where removing a prop controlled by native animated need to be reset to its default value since react no longer tracks its value. This splits restoring default values and disconnecting from views in 2 separate native methods, this way we can restore default values only on component update and not on unmount. This takes care of being backwards compatible for JS running with the older native code. ## Changelog [General] [Fixed] - NativeAnimated - Don't restore default values when components unmount Pull Request resolved: https://github.com/facebook/react-native/pull/26978 Test Plan: - Tested in an app using react-native-screens to make sure native views that are kept after their underlying component has been unmount don't change. Also tested in RNTester animated example. - Tested that new JS works with old native code Reviewed By: mmmulani Differential Revision: D18197735 Pulled By: JoshuaGross fbshipit-source-id: 20fa0f31a3edf1bc57ccb03df9d1486aba83edc4 |
||
---|---|---|
.. | ||
Drivers | ||
Nodes | ||
RCTAnimationPlugins.h | ||
RCTAnimationPlugins.mm | ||
RCTAnimationUtils.h | ||
RCTAnimationUtils.m | ||
RCTNativeAnimatedModule.h | ||
RCTNativeAnimatedModule.mm | ||
RCTNativeAnimatedNodesManager.h | ||
RCTNativeAnimatedNodesManager.m | ||
React-RCTAnimation.podspec |