tl;dr version using the useEffect hook:

useEffect(() => {

  return () => console.log("componentWillUnMount")
},[])

Hooks have REALLY grown on me as I continue to become more and more experienced developing with React. Gone are the days of needing to create an entire class in order to gain access to state and lifecycle methods. My preferred method is writing each component I create as a function and pick and choose which hooks I want to utilize depending on the particular use case for the component. I find it to be quick and easy, as just in general easier to read.

Basically, whatever function you return from useEffect hook will be invoked whenever the component is unmounted. A typical use case for this will be to clear some kind of counter or clear an event listener after the component has been unmounted.