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
This has been briefly discussed long time ago here, however I think we should reevaluate the possibility to add the onPageChange evento to the ScrollView and FlatList consequently.
The current approach is to subscribe to the onMomentumScrollEnd event and to perform some calculation based on the content offset, but this can easily lead to code duplication and bugs such as using the wrong width to divide the offset with (Dimensions API vs useWindowDimensions vs e.nativeEvent.layoutMeasurement.width) or having to keep the values in the state and constantly update it.
It is also unclear whether the event offset can really be undefined or not.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
This has been briefly discussed long time ago here, however I think we should reevaluate the possibility to add the
onPageChange
evento to the ScrollView and FlatList consequently.The current approach is to subscribe to the
onMomentumScrollEnd
event and to perform some calculation based on the content offset, but this can easily lead to code duplication and bugs such as using the wrong width to divide the offset with (Dimensions API vs useWindowDimensions vs e.nativeEvent.layoutMeasurement.width) or having to keep the values in the state and constantly update it.It is also unclear whether the event offset can really be undefined or not.
Lastly, this implementation has some issue on RTL layouts, see facebook/react-native#19150 or facebook/react-native#29220 for an example.
Beta Was this translation helpful? Give feedback.
All reactions