无法读取未定义的属性“列表”

问题描述

我正在尝试创建一个模仿 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.

解决方法

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

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

您的棋盘道具未定义,这就是您收到此错误的原因。