joe*_*not 28 reactjs visual-studio-code react-class-based-component
我一直使用类似的东西
class MyComponent extends React.Component {
constructor(props) {
super(props)
this.state = {
var1 : undefined,
var2 : 'etc...',
}
}
}
Run Code Online (Sandbox Code Playgroud)
但是今天我注意到在 VS Code 中工作时有一条划线super(props),这是以前从未有过的!?
Sco*_*son 16
我的猜测是,你的编辑器向您展示其超(道具,背景)签名的描述被弃用。它指向的那个链接是关于旧的上下文 API 如何消失的,那个特定的调用签名是离开的一部分。
但是,我还没有听说过平原super(props)消失了,您应该可以安全地继续使用它。
| 归档时间: |
|
| 查看次数: |
9094 次 |
| 最近记录: |