Skip to content

Instantly share code, notes, and snippets.

@reime005
Created January 8, 2021 18:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reime005/959699278f019f86e0a3c2f0cf207835 to your computer and use it in GitHub Desktop.
Save reime005/959699278f019f86e0a3c2f0cf207835 to your computer and use it in GitHub Desktop.
const pan = React.useRef(new Animated.ValueXY()).current;
...
<ScrollView
scrollEventThrottle={1}
onScroll={Animated.event(
[{ nativeEvent: { contentOffset: { y: pan.y } } }],
{
useNativeDriver: false,
}
)}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment