关于在React中 报Super expression must either be null or a function, not undefined (采坑系列)

  今天突然在练习React中遇到一开始就报    Super expression must either be null or a function, not undefined

百度,各种方法,。。。原来是这样(折腾半小时后一度怀疑人生)。

先看看下面三种定义类组件有什么区别

1,第一种  (React.Component   后面是没有的  括号  切记,切记

 2,第二种 (React.Component  C 没有大写)

3,第三种 (正确

 是不是懵的一看都差不多,但是只有最后一种是正确的    ,希望各种避免踩这些雷区 

  千万别像我一样憨皮了 !!!

原文地址:https://www.cnblogs.com/yezi1116/p/12724434.html