use effect like component did mount

JavaScript
useEffect(() => {
	console.log('I am the new componentDidMount')
}, [])
// Don't forget the empty array at the end
Source

Also in JavaScript: