Type of the default value for 'songs' prop must be a function

时间:2021-02-12 17:10:38

Type of the default value for 'songs' prop must be a function

eslint常会出现这样的错误提示,控制台打印:Type of the default value for 'songs' prop must be a function 

Type of the default value for 'songs' prop must be a function

 

解决办法有两种如下:

1:写一个函数,return一个数组

Type of the default value for 'songs' prop must be a function

2: ES6 箭头函数写法

Type of the default value for 'songs' prop must be a function

就可以解决这个个问题