I am not great with JS and playing around with React.
The React docs located here state the following:
When implementing the constructor for a
React.Component
subclass, you should callsuper(props)
before any other statement. Otherwise,this.props
will be undefined in the constructor, which can lead to bugs.
My question is HOW does this actually work? What is super()
doing that magically enables this.props
within my constructor?