React报错:TypeError: Super expression must either be null or a function

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/HJBZF/article/details/86064397

今天搭建一个项目主页,出现TypeError: Super expression must either be null or a function错误,如下图:

这个问题说明了我们extends的那个函数没有导出相应的属性,注意看我们错误提示Footer.js文件,我们出错语句是export default class Footer extends React.ComponentP{},应该写成export default class Footer extends React.Component{},将React.Component改为正确写法就对了。哭卿卿,以后要注意别写错单词了。

猜你喜欢

转载自blog.csdn.net/HJBZF/article/details/86064397