1import React, { useEffect } from 'react';
2
3const Component = (props) => {
4 useEffect(() => {
5 window.addEventListener('scroll', handleScroll);
6 });
7 useEffect(() => {
8 return () => {
9 window.removeEventListener('scroll', handleScroll);
10 };
11 }, []);
12
13 function handleScroll() {
14 let scrollTop = window.scrollY;
15 }
16
17
18 return ()
19}
20