effect component did mount code example
Example: use effect like component did mount
useEffect(() => {
console.log('I am the new componentDidMount')
}, [])
// Don't forget the empty array at the end
useEffect(() => {
console.log('I am the new componentDidMount')
}, [])
// Don't forget the empty array at the end