Component lifecycle useEffect example and exercise implementation