Answer the question
In order to leave comments, you need to log in
Is it good practice to use setState in redux?
Good day.
I myself have never considered this acceptable, however, some component developers (and some developers in general) mix setState and the global store state. This is convenient, because you can store internal, service properties and information in setState, but doesn't this violate the very principle of the redux architecture?
Answer the question
In order to leave comments, you need to log in
In a good way, redux takes out only what is used in different parts of the application, as well as data received from the server. For the rest, it is preferable to use the state of the component. In the vast majority of cases, lifting state up will be preferable to using redux. Dan Abrabomov's answer to a similar question
How to choose between Redux's store and React's state .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question