I'm trying to return the response from an API call but all I'm getting is a lousy promise. When I log the obj returned from fetchProducts and setProducts using useState I'm getting undefined
async function fetchProducts() {
const url = 'http://127.0.0.1:8000/products'
const obj = await (await fetch(url)).json();
return obj
}