FlatList onScroll event
See original GitHub issueHello All,
I have an issue that when I use FlatList to create horizontal scroll I need to listen for OnScroll event.
When I mapping Native event with event() I receive error that I need to add Animated prefix to FlatList to use event(), however then I receive error:
Invariant violation: element type is invalid: expect a string or class/function but got undefined.
Does FlatList is working in reanimated? When I changed FlatList to ScrollView it worked with Animated.ScrollView . Do we have any working example with OnScroll and FlatList?
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
react native - How to know the state of scroll in FlatList?
there is onScroll mothed,but it only run when Scrolling. I want to listen scroll start and end,how can i do ? I also...
Read more >FlatList
A performant interface for rendering basic, flat lists, supporting the most handy features:
Read more >How to find out FlatList scroll direction - mobiledevtutorials
when onScroll the event fired, we need to compare contentOffset value with the previous value. then also we need to know if it's...
Read more >How to find out FlatList scroll direction | by Nazır Doğan
when onScroll the event fired, we need to compare contentOffset the value with the previous value. then also we need to know if...
Read more >useAnimatedScrollHandler | React Native Reanimated
event [object] - event object carrying the information about the scroll. The payload can differ depending on the type of the event (...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @davx1992. react-native-reanimated does not provide an Animated FlatList, but it provides the ScrollView component, so you can use
renderScrollComponent
to provide an Animated ScrollView to your FlatList:I can’t make it works, it’s like the
renderScrollComponent
prop is not called.