When adding an event to a ScrollView in react-native, I noticed the event handler was not firing, and the app will eventually and silently crash after a few seconds.
This is what my handler looked like, all I was doing was a simple console.log on the event:
// Does not work:
<FlatList
...
onScrollEndDrag={e => {
console.log(e);
}}
...
/>
I noticed that if I didn't pass the parameter, the event handler worked:
// Works:
<FlatList
...
onScrollEndDrag={e => {
console.log('event');
}}
...
/>
But I can't access my event data.
Why is the event handler failing when I try to access the event with console.log here?