Answer the question
In order to leave comments, you need to log in
How to determine the state of a component?
Hi all. Guys, how do you determine what should be in the state?
For example, I have problems with this (
UPD: Example:
Here is an example, I visually added how I divided it all, the green arrows from the text indicate which state I assigned them to.
https://prnt.sc/iyfd7y
Answer the question
In order to leave comments, you need to log in
State is written in
state . If the component is in different states, they must be fixed. Data received from the user or from the server is also a state. Another question is, what state can be used directly by the component, the parent, or even put into the redux store ? To understand this issue well, you need experience and knowledge gained by analyzing and comparing different solutions in the context of different tasks. Study good code, read articles, write.
If you have more specific questions, please feel free to ask.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question