随便使用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

相关文章:

  • 2021-11-13
  • 2021-09-19
  • 2022-12-23
  • 2021-08-02
  • 2021-06-01
  • 2021-08-31
  • 2022-12-23
  • 2021-08-15
猜你喜欢
  • 2022-12-23
  • 2023-03-10
  • 2022-12-23
  • 2022-12-23
  • 2022-01-11
  • 2021-12-18
相关资源
相似解决方案