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
Create an async function inside your effect that wait the getData(1) result then call setData():
getData(1)
setData()
useEffect(() => { const fetchData = async () => { const data = await getData(1); setData(data); } fetchData(); }, []);