关于我无法弄清的承诺有一些问题,因此当我在搜索栏中键入例如``比萨''并单击search.Console输出时出现此错误TypeError:Cannot read property'forEach'of未定义
我试图寻找任何拼写错误,但找不到任何东西。
这是我的github存储库:https://github.com/damianjnc/forkifyApp
任何人都可以看到导致错误的原因以及如何对其进行调试?
答案 0 :(得分:0)
我可能会记错了,但我感觉是这样的(在SearchView.js中):
export const renderResults = recipes => {
recipes.forEach(renderRecipe);
};
应如下所示:
export const renderResults = recipes => {
recipes.forEach(recipe => renderRecipe(recipe));
};
请告诉我这是否有帮助。干杯!