Skip to content

Commit

Permalink
Disable animation native driver in AnimatedGratuisousApp of RNTester (#…
Browse files Browse the repository at this point in the history
…23172)

Summary:
`Animated.event` not work with direct events and not bubbling events, which means it does not work with `PanResponder`, please see [Animation Caveats](https://facebook.github.io/react-native/docs/animations#caveats)

Changelog:
----------

[General] [Fixed] - Disable animation native driver in AnimatedGratuisousApp of RNTester.
Pull Request resolved: #23172

Differential Revision: D13838555

Pulled By: cpojer

fbshipit-source-id: 866bc83e780d6712ffae5964615af44a72bf998c
  • Loading branch information
zhongwuzw authored and facebook-github-bot committed Jan 28, 2019
1 parent b0302ec commit 8508da4
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions RNTester/js/AnimatedGratuitousApp/AnExSet.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,17 @@ class AnExSet extends React.Component<Object, any> {
inputRange: [0, 300], // and interpolate pixel distance
outputRange: [1, 0], // to a fraction.
}),
useNativeDriver: true,
}).start();
},
onPanResponderMove: Animated.event(
[null, {dy: this.state.dismissY}], // track pan gesture
{useNativeDriver: true},
),
onPanResponderRelease: (e, gestureState) => {
if (gestureState.dy > 100) {
this.props.onDismiss(gestureState.vy); // delegates dismiss action to parent
} else {
Animated.spring(this.props.openVal, {
toValue: 1, // animate back open if released early
useNativeDriver: true,
}).start();
}
},
Expand Down

0 comments on commit 8508da4

Please sign in to comment.