Open kolking opened 1 year ago
@kmagiera could you please find some time to look into the issue since you're the one who implemented the animated tracking with the native driver in React Native v0.55.0?
I found your old tweet and attempted to run the Chat Heads example from the react-native-gesture-handler
repo https://github.com/software-mansion/react-native-gesture-handler/blob/main/example/src/showcase/chatHeads/index.tsx
In the example, the USE_NATIVE_DRIVER
constant is set to false
by default, and it works fine in the JS thread. However, when changing USE_NATIVE_DRIVER
to true
, it does not work as expected. Instead of animating the followers simultaneously, their spring animation only starts after the parent's animated value stops changing.
Description
Tracking a dynamic animated value (such as scroll position) using the native driver doesn't work correctly. Instead of animating the pinned value simultaneously, the animation only starts once the dynamic value stops changing.
React Native Version
0.71.11
Output of
npx react-native info
Steps to reproduce
I have created an example app that illustrates the problem.
App.tsx
change theNATIVE_DRIVER
constant totrue
, reload the app and try scrolling the bottom part again.Snack, code example, screenshot, or link to a repository
Also please take note that when the native driver is enabled, it ignores the initial
contentOffset
. As a result, the red dots are initially displayed on the left and will only move to the center after a manually triggered scroll event.useNativeDriver: false
useNativeDriver: true