function LifeCycle(props) { const [updateCount, setUpdateCount]= React.useState(0); React.useEffect(() => { console.log("Effect function has run - same life-cycle as componentDidMount and componentDidUpdate"); // Specify how to clean up after this effect: return function cleanup() { console.log("Cleanup Effect function has run - same life-cycle as componentWillUnmount"); }; }); function handleClick(e) { setUpdateCount(updateCount+1); } return (

LifceCycle Component

The lifecycle Component sees {props.count} clicks and {updateCount} update count.

An update mounts and unmounts (cleanup). Try it by clicking below

) }