Is it bad practice to use state components without going through the reduction?
2 answers
In the Redux FAQ entry about component state and Redux state :
Using local component state is fine. As a developer, your job is to determine which state your application is made up of and where each state should live. Find a balance that works for you and go with it.
Some general rules for determining what data should be put into Redux:
- Do other parts of the application leave this data?
- Do you need to be able to create additional derived data based on this raw data?
- Is the same data used to control multiple components?
- Do you have value in restoring this state to a given point in time (i.e. debugging in time)?
- Do you want to cache the data (i.e. use what's in the state if it already exists instead of re-requesting it)?
+3
source to share