mercredi 2 mai 2018

Reactjs Listen for scroll events

Hello React People
I'm new with reactJs and i'm working on a small application as an intern with a company, I have a good experience with web development and it's for the first time that i'm wondering how can I listen for scroll ends event.

I know that

window.addEventListener('scroll', () => {
       (!this.state.showScrollWidget) ? this.setState({showScrollWidget: true}) : null;})

Allows me to listen for scroll events, but in my case i'm looking for a way to trigger an events once the user stop scrolling.

If anyone have idea about the best way to do it i will appreciate the help, otherwise if there is any third party library that may do the job i will also appreciate any suggestions.

Thanks.




Aucun commentaire:

Enregistrer un commentaire