TypeError: Cannot read property 'map' of null

定位bug:数组遍历map导致的 

{(arr).map(i => (
     return i>10
))}

解决方法:数组加空值兼容即可

{(arr || []).map(i => (
     return i>10
))}

 

posted @ 2021-09-28 11:42  bingxiaoxiao  阅读(433)  评论(0)    收藏  举报