源码之家

  • 首页
  • 文章
  • 问答
  • 下载
您的位置: 首页  >  文章  >  Objects are not valid as a React child

Objects are not valid as a React child

分类: 文章 • 2024-08-07 15:24:28

随便使用react渲染了几条数据,就开始报错误 Objects are not valid as a React child

Objects are not valid as a React child
组件中的代码如下
Objects are not valid as a React child

报错原因为 虽然渲染的数据为数组, 但是渲染的item单条数据为对象,而非数组,但是在render中是不能渲染对象的,所以才会一直报错

Objects are not valid as a React child

报错解决:只需要将渲染的数据对象变成获取对象下的具体的值即可

Objects are not valid as a React child

相关推荐

  • Objects are not valid as a React child
  • CSS 伪类(下)结构性伪类\UI伪类\动态伪类和其他伪类 valid check enable child required link visit...
  • react —— 解决报错之 Objects are not valid as a React child (found: [object HTMLDivElement]). If you meant
  • Uncaught Error: Objects are not valid as a React child (found: object with keys {content, key, durat
  • 【React】React.Children.only expected to receive a single React element child
  • react-native中debug报错信息:Each child in an array or iterator should have a unique "key" prop.
  • react之运行webpack报错:Error: Plugin/Preset files are not allowed to export objects, only functions
  • React Native FlatList onPress for child
  • React组件不在firebase child_update事件上重新呈现
  • 在调用父函数设置父状态后,React Child组件会挂载然后卸载
  • VS编译报错====Warning C4819
  • mqtt程序编译连接时缺少动态库
    网站免责声明 网站地图 最新文章 用户隐私 版权申明
本站所有数据收集于网络,如果侵犯到您的权益,请联系网站进行下架处理。   

Copyright © 2018-2021   Powered By 源码之家    备案号:   粤ICP备20058927号