我一直使用类似的东西
class MyComponent extends React.Component {
constructor(props) {
super(props)
this.state = {
var1 : undefined,
var2 : 'etc...',
}
}
}
但是今天我在 VS Code 中工作时注意到 super(props)
上有一条划线线。 ,这是以前从未有过的!?发生了什么变化? (弹出窗口中文档的链接不是很有帮助)
最佳答案
它看起来像一个错误。请参阅 - here用于解释,并有一个来源的链接。
关于reactjs - React super(props) 被弃用了吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63931230/