two useeffects in react component code example
Example 1: useeffect react
useEffect(() => {
window.addEventListener('mousemove', () => {});
// returned function will be called on component unmount
return () => {
window.removeEventListener('mousemove', () => {})
}
}, [])
Example 2: React Hook "useEffect" is called in function
React component names need to start with a capital letter.
That's because React treats components starting with lowercase letters as DOM tags.
Therefore you should name it "Shoes"