TypeError: Cannot read property 'map' of null

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

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

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

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

 

你可能感兴趣的:(TypeError: Cannot read property 'map' of null)