Skip to content

Instantly share code, notes, and snippets.

@shreyakupadhyay
Last active February 22, 2021 09:19
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 shreyakupadhyay/2efee77a8944d87b1e2bfe778fae2de0 to your computer and use it in GitHub Desktop.
Save shreyakupadhyay/2efee77a8944d87b1e2bfe778fae2de0 to your computer and use it in GitHub Desktop.
Parent component of Image Lazy Load component React-Native
class LazyLoadParent extends Component {
const container = React.createRef(null);
return (
<>
<ScrollView
showsVerticalScrollIndicator={false}
scrollEventThrottle={10}
onScroll={(event) => {
container.current.onScroll();
}}
bounces={false}
scrollEnabled={true}
>
<View>
<ImageLazyLoad
ref={container}
/>
</View>
</ScrollView>
</>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment