我试图将对象数组(最终将替换为实际数据的axios调用)从父组件传递到子组件,并进一步从一个子组件传递到其他子组件,但我无法传递,因为我收到错误消息“对象作为React子组件无效(找到:带键的对象)。如果您打算呈现一个子对象集合,请改用数组。” /ABC.js import React from 'react'
im
它给出了一个错误:“对象作为React子对象无效(找到:带有键{itemss}的对象)。如果要呈现一个子集合,请使用数组。”为什么{i.title}是一个对象。只是一根绳子。我怎么才能解决这个问题?实际上,我如何迭代嵌套的对象?class ShopItem extends React.Component {
var items = [ lin
链接和折叠是关于打开子菜单。谢谢你的帮助。对象作为React子对象无效(找到:带有键{$$typeof、type、compare、displayName、muiName}的对象)。- Sidebar.jsimport React from "react";
import classNames from "class
div> );},
这将返回Invariant Violation: Objects are not valid as a Reactcollection of children, use an array instead or wrap the object using createFragment(object) from the React