Skip to content

Instantly share code, notes, and snippets.

@alexkuttig
Last active March 24, 2018 16:14
Show Gist options
  • Save alexkuttig/52371b884df57747af20519152151962 to your computer and use it in GitHub Desktop.
Save alexkuttig/52371b884df57747af20519152151962 to your computer and use it in GitHub Desktop.
state: {
scrollY: Animated.Value,
} = {
scrollY: new Animated.Value(0)
};
renderContentArea = () => {
if (this.props.children) {
return (
<ScrollView
showsVerticalScrollIndicator={false}
scrollEventThrottle={16}
onScroll={
Animated.event(
[{nativeEvent: {contentOffset: {y: this.state.scrollY}}}]
)}
>
<View style={styles.contentContainer}>
{
this.props.children
}
</View>
</ScrollView>
)
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment