I do not really like JS and play with React.
The React docs located here report the following:
When implementing a constructor for a subclass, React.Componentyou must call super(props)before any other statement. Otherwise, it this.propswill be undefined in the constructor, which can lead to errors.
React.Component
super(props)
this.props
My question is: HOW does this really work? What is super()what magically includes this.propsinside my constructor?
super()
In the documentation you mentioned. It is encoded in ES6 javascript standard.
So this statement
class Greeting extends React.Component
, Greeting React.Component, super, props,
super
props
this.props constructor, super(props)
constructor
Hope .
Source: https://habr.com/ru/post/1667685/More articles:How to remove negative duplicates from an array? - arraysAngularJS - Фильтровать уже выбранные элементы из ng-select внутри ng-repeat - javascriptMicroservices and layered architecture - architectureStream without a sink - google-cloud-dataflowBigtable-BigQuery Import via DataFlow: 2 questions on splitting tables and timestamps - google-cloud-bigtableKnowledge transfer in regularized linear regression - pythonHow to configure @BindingAdapter using Picasso? - androidProblem with Google Custom Search API - google-search-apiHow to lie down to join two unrelated objects with JPA criteria? - java-eeIonic / Cordova build iOS after adding watchOS target - iosAll Articles