From f3dd07531cf3e933a9c31409e0ff28b6c08b5e24 Mon Sep 17 00:00:00 2001 From: Mark Miyashita Date: Sun, 19 Jul 2015 17:05:25 -0700 Subject: [PATCH] [Docs] Animated example for onScroll and onPanResponderMove should match the description in the paragraph above --- docs/Animations.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/Animations.md b/docs/Animations.md index 5d66268b2..49cbce7d3 100644 --- a/docs/Animations.md +++ b/docs/Animations.md @@ -205,12 +205,12 @@ map syntax so that values can be extracted from complex event objects. The first level is an array to allow mapping across multiple args, and that array contains nested objects. In the example, you can see that `scrollX` maps to `event.nativeEvent.contentOffset.x` (`event` is normally the first arg to the -handler), and `pan.x` maps to `gestureState.dx` (`gestureState` is the second -arg passed to the `PanResponder` handler). +handler), and `pan.x` and `pan.y` map to `gestureState.dx` and `gestureState.dy`, +respectively (`gestureState` is the second arg passed to the `PanResponder` handler). ```javascript onScroll={Animated.event( - [{nativeEvent: {contentOffset: {y: pan.y}}}] // pan.y = e.nativeEvent.contentOffset.y + [{nativeEvent: {contentOffset: {x: scrollX}}}] // scrollX = e.nativeEvent.contentOffset.x )} onPanResponderMove={Animated.event([ null, // ignore the native event