reactjsvisual-studio-codereact-class-based-component

Is React super(props) deprecated?


I've always used something similar to

class MyComponent extends React.Component {
    constructor(props) {
        super(props)
        
        this.state = {
            var1 : undefined,
            var2 : 'etc...',
        }
    }
}

But today I noticed while working in VS Code there is a strike-thru line on super(props), which was never there before !?

enter image description here What has changed? (the link to the docs in the popup is not very helpful)


Solution

  • It looks like a bug. Please see - here for explanation and there is a link to a source.