Answer the question
In order to leave comments, you need to log in
How to understand how the getInitialState method works?
Hello. While studying React, I come across a description of the getInitialState method inside the component class. But the method (getInitialState) is not called anywhere. Is it some kind of internal component method? Help me to understand.
Answer the question
In order to leave comments, you need to log in
In ES6, the class constructor is used to set the initial state, and since there are no classes in ES5, this method and several others are used .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question