In the tutorial published by reactjs.org, it was stated that "Class components should always call the base constructor with props
". In my own research, it seems that super(props)
can be replaced by super()
if this.props
is not used in the constructors, according to this StackOverflow answer.
Therefore, my question is, why should we always pass in props
to base constructor in reactjs? Is the advice sound? Why is the advice sound (or not sound)?
P.S. A screenshot is uploaded to this question just in case the original tutorial is updated while this question is being answered.