Skip to content

Instantly share code, notes, and snippets.

@reime005
Created January 12, 2021 23:48
Show Gist options
  • Save reime005/b3616494f9d18eb95af4ff9b16ef8d6d to your computer and use it in GitHub Desktop.
Save reime005/b3616494f9d18eb95af4ff9b16ef8d6d to your computer and use it in GitHub Desktop.
const openAnim = () => {
Animated.spring(pan.y, {
toValue: screenHeight - MODAL_HEIGHT,
bounciness: 0,
useNativeDriver: true,
}).start();
};
const closeAnim = () => {
Animated.spring(pan.y, {
toValue: screenHeight,
useNativeDriver: true,
}).start();
// callback (to toggle state)
props.onClose();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment