I would like to call an async function and get the result for my UseEffect.
The fetch api examples i found on the internet are directly made in the useEffect functio
If you're invoking it right-away you might want to use it as an anonymous function:
useEffect(() => { (async () => { const data = await getData(1); setData(data); })(); }, []);