#What's wrong with my code
3 messages · Page 1 of 1 (latest)
Also:
let json = data.json();
.json() is async and returns a promise. You need to await it as well:
let json = await data.json();
Also, as per the react documentation, useEffect does not support async functions:
See here:
https://beta.reactjs.org/reference/react/useEffect