Listener in Animated.event
See original GitHub issue onScroll={event(
[
{
nativeEvent: {
contentOffset: {
y: this.scrollY
}
}
}
],
{
listener: () => {
console.log('scrolling');
}
}
)}
As in original Animated library, how do I pass a listener like this?
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
React-native animated.event custom onScroll listener
When you look at the source code: /** * Takes an array of mappings and extracts values from each arg accordingly, * then...
Read more >Animated.event - React Native Animated for Beginners
Animated.event. This is just a helper function to map arbitrary data to Animated values. Check out the docs for their explanation ...
Read more >Animated - React Native
Imperative API to attach an animated value to an event on a view. Prefer using Animated.event with useNativeDrive: true if possible. Is this ......
Read more >Element: animationend event - Web APIs | MDN
The animationend event is fired when a CSS Animation has completed. If the animation aborts before reaching completion, such as if the element ......
Read more >Animated and React Native ScrollViews | by evening kid
In today's chapter, let's learn about animated events with scroll views. This was first published as a video for the How To Animated...
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
I would like to add another one example to use
call
, because it was unclear for me how to usecall
to solve requested issue: capture scroll position on JS side. For me there was an solution:Thank you for this issue! let us suppose that you have some
Animated.Value
V
which applies some style to some view.In this case if you wish some code executed as listener for this value, simply use:
and
Now on each evaluation of
V
,wrappedV
will be evaluated as well, but it will include its side-effect with thiscall
node.call
accepts array of nodes which will be passed as array of current values to function given as second argument