W
W
WarriorKodeK2018-03-29 23:29:16
JavaScript
WarriorKodeK, 2018-03-29 23:29:16

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

1 answer(s)
A
Anton Spirin, 2018-03-30
@WarriorKodeK

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 question

Ask a Question

731 491 924 answers to any question