Answer the question
In order to leave comments, you need to log in
How to track state changes?
Let's say I have three fields in the state, one is the amount, another is the discount, and the third is the result. And now let's say that there are 10 fields and they change in different places and at different times.
The question is this - is there a way for the resulting field to "watch" for changes in the required fields in order to construct its value from them. A similar analogue is controlled components, so I would also like to do it with the desired field in the state.
Answer the question
In order to leave comments, you need to log in
It is better not to store the resulting fields at all, but to count the values after the fact.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question