Recommendations 🔗︎
So, how do you decide whether to use Context, Context + useReducer, or Redux + React-Redux?
You need to determine which of these tools best matches the set of problems that you're trying to solve!
If the only thing you need to do is avoid prop-drilling, then use Context
If you've got some moderately complex React component state, or just really don't want to use an external library, go with Context + useReducer
If you want better traceability of the changes to your state over time, need to ensure that only specific components re-render when the state changes, need more powerful capabilities for managing side effects, or have other similar problems, use Redux + React-Redux
My personal opinion is that if you get past 2-3 state-related contexts in an application, you're re-inventing a weaker version of React-Redux and should just switch to using Redux.