From e3a6be5d37c816fc3abd19d3c9529f09aafb345a Mon Sep 17 00:00:00 2001 From: Chris Geirman Date: Tue, 26 Sep 2017 10:19:39 -0700 Subject: [PATCH] explicitly show how to add the optional listener Summary: The previous example only showed where to add the optional "listener" but didn't show how to make use of it. (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 https://github.com/facebook/react-native/pull/15576 Differential Revision: D5911716 Pulled By: shergin fbshipit-source-id: 60023470d23c2cbbde47ab9aa82c7ecef73be467 --- Libraries/Animated/src/AnimatedImplementation.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Libraries/Animated/src/AnimatedImplementation.js b/Libraries/Animated/src/AnimatedImplementation.js index ab493f09138893..3e32591f7c9e89 100644 --- a/Libraries/Animated/src/AnimatedImplementation.js +++ b/Libraries/Animated/src/AnimatedImplementation.js @@ -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 * ]), *``` *