【问题标题】:Cannot read property 'lists' of undefined无法读取未定义的属性“列表”
【发布时间】:2021-04-21 17:50:08
【问题描述】:

我正在尝试创建一个模仿 trello 的 Web 应用程序。我不断收到此错误,我不确定如何解决它。该代码在另一个项目中运行良好,但当我尝试将其添加到这个新项目时却不行。所有依赖项都已更新。我在谷歌浏览器上运行它。我读到这可能是 chrome 的问题?

This is the error that I am receiving on my browser. There are no errors in my IDE.

This is the code that is producing this error. The code works fine in another IDE but once I try to integrate the component into my new app it crashes.

【问题讨论】:

  • 欢迎来到stackoverflow。请避免发布问题的图片,而是对其进行描述或将显示的代码粘贴到堆栈 sn-p 中。即使图像的 url 消失了,这个问题也应该是可以理解的。显示问题的最佳方式是使用minimal reproducable example

标签: javascript reactjs droppable react-dnd react-beautiful-dnd


【解决方案1】:

确保您在“板”道具中的列表键中获取数组并尝试使用可选的 Channing

{
  boar?.list?.map(..)
}

您的电路板道具未定义,这就是您收到此错误的原因。

【讨论】:

  • 这可以修复错误,但其余代码无法正常运行。
猜你喜欢
  • 2017-10-19
  • 2020-10-31
  • 2021-09-30
  • 1970-01-01
  • 1970-01-01
  • 2020-04-06
  • 2020-10-30
  • 2019-10-09
相关资源
最近更新 更多