我是React新手,我正在通过最新版本的React学习React组件生命周期.我对下面部分代码的"super"调用被标记为不推荐的警告.我很难理解这一点,因为很多文档仍然使用"super",而且我不确定后续版本是什么,甚至从反馈中链接的完整文章来看也是如此.有什么 idea 吗?谢谢
class App extends Component {
constructor(props) {
super(props);
}
}
以下是警告:
constructor React.Component<any, any, any>(props: any, context?: any): React:Component<any, any, any> (+1 overload)
@deprecated
@see - https://reactjs.org/docs/legacy-context.html
'(props: any, context?: any): Component<any, any, any>' is deprecated ts(6385)