React has something called a state. What is it and how it is used?

Posted by Andre Scott | Updated on

States are the source of data for React components. In other words, they are objects responsible for determining components behavior and rendering. As such, they must be kept as simple as possible.

Accessible by means of this.state(), state is mutable and creates dynamic and interactive components. Use of a state can be visualized by the following code snippet:


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers