You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I recently upgraded from 18.11 to 19.6, and I noticed that some of my components that use FlatList and rely on viewabilityConfig were no longer working properly. It seems onViewableItemsChanged stops working in some very specific cases. In the repro I provide, viewability breaks when I run Animated.loop on an animation that has useNativeDriver set to false, and after changing state on the data being rendered by the FlatList.
However, after fixing the issue by setting useNativeDriver: true on the animation that was causing it, I found that other areas of my app where also causing viewability to break even though I had no other instances of Animated.loop being called, so clearly this is not the only case that can cause this viewability issue to occur.
This is important for us because we rely on viewabilityConfig to determine when videos in a flatlist should stop/start playing.
Thanks for the great work bringing react native to the web!
Expected behavior
For onViewableItemsChanged to be called as expected, regardless of whether an animation is running in another part of the app
Steps to reproduce
Create FlatList with viewability config props passed in:
I am not familiar with React Native internals, so I just hope this repro can point you to the root cause and help solve this problematic issue. Thank you!!
The text was updated successfully, but these errors were encountered:
The web fork of Animated and VirtualizedList is no longer being maintained, but updating it is blocked on this React Native issue that will allow RN Web to install the same packages used in RN. You should comment there facebook/react-native#35263
Is there an existing issue for this?
Edit: #2566 may be related
Describe the issue
Hello, I recently upgraded from 18.11 to 19.6, and I noticed that some of my components that use FlatList and rely on
viewabilityConfig
were no longer working properly. It seems onViewableItemsChanged stops working in some very specific cases. In the repro I provide, viewability breaks when I run Animated.loop on an animation that has useNativeDriver set to false, and after changing state on the data being rendered by the FlatList.However, after fixing the issue by setting useNativeDriver: true on the animation that was causing it, I found that other areas of my app where also causing viewability to break even though I had no other instances of Animated.loop being called, so clearly this is not the only case that can cause this viewability issue to occur.
This is important for us because we rely on viewabilityConfig to determine when videos in a flatlist should stop/start playing.
Thanks for the great work bringing react native to the web!
Expected behavior
For
onViewableItemsChanged
to be called as expected, regardless of whether an animation is running in another part of the appSteps to reproduce
with the following values for
viewabilityConfigCallbackPairs
:Test case
https://codesandbox.io/s/weird-virtualizedlist-2rc2ln?file=/src/App.js
Additional comments
I am not familiar with React Native internals, so I just hope this repro can point you to the root cause and help solve this problematic issue. Thank you!!
The text was updated successfully, but these errors were encountered: