React Native中的superprops是真的不推荐使用还是只是Vs代码警告?

问题描述

我在vs代码中收到了关于弃用super(props)的警告,但在警告消息中提到的链接中找不到有用的信息。

警告:

'(props: any,context?: any): Component<any,any,any>' is deprecated
@deprecated
@see — https://reactjs.org/docs/legacy-context.html

我的组件类中的构造函数:

constructor(props) {
    super(props);
    this.state = {
    };
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)