Skip to content

Instantly share code, notes, and snippets.

@reime005
Created August 9, 2020 19:54
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/219449c5b55f8e015c0e47732aace254 to your computer and use it in GitHub Desktop.
Save reime005/219449c5b55f8e015c0e47732aace254 to your computer and use it in GitHub Desktop.
export default Example = () => {
const [contentOffset, setContentOffset] = React.useState({ x: 0, y: 0 });
const [contentSize, setContentSize] = React.useState(0);
return(
<ScrollView
onScroll={e => {
setContentOffset(e.nativeEvent.contentOffset);
}}
onContentSizeChange={(_, height) => {
setContentSize(height);
}}
>...
</ScrollView>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment