[英]why my map function is not working to display API data on browser?
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.
我想要数组中每个产品的 Image 组件。
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);
您必须映射data
:
res.data?.categories.data.map()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.