Asynchronous calls in React : useEffect() + useState()