Convertir el componente se montó en USEFECT

useEffect(() => {
  // code run when the component is mounted 

  // Make sure this is empty to ensure hook will only run once
}, [])
Vast Vulture