convertir componenteWillunMount en UseEffect

useEffect(() => {
  return () => {
    // code to run when the component is unmounted
  }
})
Vast Vulture