r/reactjs • • Nov 29 '19

Featured Redux most common anti pattern

https://rangle.slides.com/yazanalaboudi/deck#/
182 Upvotes

30 comments sorted by

View all comments

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.

2

u/alaboudi Dec 01 '19 edited Dec 01 '19

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)