报错内容完整如下:

Objects are not valid as a React child (found: [object HTMLDivElement]). If you meant to render a collection of children, use an array instead.

根据提示,说我的React child是一个对象不行,得换成数组

错误的写法:直接使用DOM使用appendChild来操作

正确的写法:放在一个数组里就行了

react —— 解决报错之 Objects are not valid as a React child (found: [object HTMLDivElement]). If you meant

 

 

相关文章:

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