Closed Gipfel closed 3 years ago
There is at least two issue with your code I can spot, first of all, you are suppose to use this package in server side.
Second, you can't use async like that in useEffect
you need to wrap it inside function
useEffect(() => {
const fetchData = async () => {...};
fetchData();
}, []);
And error you ran into (Unhandled Rejection (TypeError): Failed to fetch
) is sounds like cors issue.
Closing due to not being package issue.
Hey, I am pretty new on working with APIs and ReactJS and I tried to fetch this API by this React-App and I always get the Error "Unhandled Rejection (TypeError): Failed to fetch", in detail: const id = await r6api.getId(platform, username).then(el => el[0].id); I am thankful for every respond.