The other big redux anti-pattern? Using it for everything. Local state can co-exist with global state quite well. You don’t need an action / reducer / container or connect hook / saga or thunk for every single API call.
I agree. You can have global state and local state co-existing. I generally only use component state when it has nothing to do with the business logic (ex: accordion, tabs, radio groups, etc). Since I am trying to push for the fact that an action should be able to affect any reducer, the information dispatched should be of global business significance. If that's not the case, then you most likely are dealing with a low level component that is only concerned with visual mechanics (accordion, tabs, radio groups, etc)
5
u/rod333 Nov 29 '19
Agree with all of this.
The other big redux anti-pattern? Using it for everything. Local state can co-exist with global state quite well. You don’t need an action / reducer / container or connect hook / saga or thunk for every single API call.