I am trying to access the results (here it is the 'body') of the fetch but keep getting this :
Promise {< pending >} proto : Promise [[PromiseStatus]] : "resolved" [[PromiseValue]] : Array(100)
it says resolved but isnt just giving me the array I want.
here is my code
let Categories = fetch('http://localhost:3001/categories?' )
.then((response) => {
var data = response.json();
return data;
}).then((body) => {
console.log("fetching categories...")
console.log(body.categories)
return body.categories
})
console.log(Categories)
export default Categories
the above result comes from the console.log(Categories)