4 very useful React tips. — 1. Don’t forget to remove the listener when the component is Unmounting. We often need to listen to keyboard events, mouse events, etc. in useEffect of React. But we often forget to remove them. const windowScroll = () => {
console.log('scroll')
}
useEffect(() => {
window.addEventListener("scroll", windowScroll, false)
}, []) Yes, when we return to this component, the scroll event will be…