Skip to content

Commit

Permalink
explicitly show how to add the optional listener
Browse files Browse the repository at this point in the history
Summary:
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: http://facebook.github.io/react-native/docs/contributing.html

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 e3a6be5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Libraries/Animated/src/AnimatedImplementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -839,12 +839,13 @@ module.exports = {
*```javascript
* 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
* ]),
*```
*
Expand Down

0 comments on commit e3a6be5

Please sign in to comment.