Browse files

explicitly show how to add the optional listener

The previous example only showed where to add the optional "listener" but didn't show how to make use of it.

Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to React Native here:

Happy contributing!


(Write your motivation here.)

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos!)
Closes #15576

Differential Revision: D5911716

Pulled By: shergin

fbshipit-source-id: 60023470d23c2cbbde47ab9aa82c7ecef73be467
  • Loading branch information...
geirman authored and facebook-github-bot committed Sep 26, 2017
1 parent 6f6329d commit e3a6be5d37c816fc3abd19d3c9529f09aafb345a
Showing with 2 additions and 1 deletion.
  1. +2 −1 Libraries/Animated/src/AnimatedImplementation.js
@@ -839,12 +839,13 @@ module.exports = {
* onScroll={Animated.event(
* [{nativeEvent: {contentOffset: {x: this._scrollX}}}],
* {listener}, // Optional async listener
* {listener: (event) => console.log(event)}, // Optional async listener
* )}
* ...
* onPanResponderMove: Animated.event([
* null, // raw event arg ignored
* {dx: this._panX}, // gestureState arg
{listener: (event, gestureState) => console.log(event, gestureState)}, // Optional async listener
* ]),

0 comments on commit e3a6be5

Please sign in to comment.