Learning React from the docs and came across this example:
class Square extends React.Component { constructor() { super(); this.state = { val
When implementing the constructor for a React.Component subclass, you should call super(props) before any other statement. Otherwise, this.props will be undefined in the constructor, which can lead to bugs.
React.Component subclass
super(props)
this.props
undefined