I'm trying to get this extremely simple React Native (Expo) Code to work:
Inside my App.js:
return (
<ScrollView
scrollEventThrottle={16}
onScroll={console.log("Scrolled")}>
<Text style={{fontSize: 30}}>
...
</Text>
</ScrollView>
)
It seems as if onScroll would only be fired once when I'm first starting the App, but is not responding to actual scrolling. Any ideas on what could be blocking it?
(using Expo version 3.17.18)
I'm guessing the way that the onScroll is written could be causing it to never trigger it more than once. Please try the following code (I would also recommend having an scrollEventThrottle of 400 or so, 16 will be triggered far too many times, but I wouldn't say that's the root of the current issue):
return (
<ScrollView
scrollEventThrottle={16}
onScroll={({nativeEvent}) => {console.log("Scrolled")}}>
<Text style={{fontSize: 30}}>
...
</Text>
</ScrollView>
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With