Reputation: 379
I am getting the data in console but, unable to find the correct path to map over data in nested map functions. I want an Image component for every product in array.
I am trying this path to map over object given below in picture.
This is the query having async function that fetched the data.
const res = useCategoriesQuery({
type: query.type,
text: query?.text,
category: query?.category,
});
console.log(res);
Upvotes: 0
Views: 661
Reputation: 85575
You have to map over the data
:
res.data?.categories.data.map()
Upvotes: 3