You get a bonus - 1 coin for daily activity. Now you have 1 coin

What is the difference between super() and super(props) in React using ES6 classes? in REACT

Practice



If you want to access

this.props
in the
constructor()
then you must pass props to the
super()
method.

Using

super(props)
:
class MyComponent extends React.Component {
  constructor(props) {
    super(props)
    console.log(this.props) // { name: 'John', ... }
  }
}
Using super()
:

Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "Scripting client side JavaScript, jqvery, BackBone"

Terms: Scripting client side JavaScript, jqvery, BackBone