Skip to content

Instantly share code, notes, and snippets.

@dineshkp-dev
dineshkp-dev / App.js
Created January 1, 2020 10:25 — forked from koistya/App.js
How to add `onscroll` event in ReactJS component
import React from 'react';
let lastScrollY = 0;
let ticking = false;
class App extends React.Component {
componentDidMount() {
window.addEventListener('scroll', this.handleScroll, true);
}