What's the difference between "super()" and "super(props)" in React when using es6 classes?
Asked 07 September, 2021
Viewed 1.7K times
  • 52
Votes

When is it important to pass props to super(), and why?

class MyComponent extends React.Component {
  constructor(props) {
    super(); // or super(props) ?
  }
}

10 Answer