React Context + useReducer - Still to this day my favorite way of managing global state in React, no extra dependencies, no learning curve, it’s all there built-in

2 points

It really depends on what kind of state you’re storing. For UI or other client stuff usually a context provider is enough. For server data/state I started using React Query a lot more. It syncs server data across components that use the same cache key, which is really powerful.

permalink
report
reply
1 point

Just curious - have you applied this in big React applications?

The reason I’m asking is because all context consumers get re-rendered immediately upon context value update. It might be ok for small apps but bigger apps can suffer.

permalink
report
reply
-1 points

Small to medium this can definitely work, large scale ( ex. Airbnb ) still works better with redux but i still see people misusing redux in smaller apps where you don’t really need it

It’s not just redux people really like to overengineer stuff nowadays

permalink
report
parent
reply

React

!react@programming.dev

Create post

A community for discussing anything related to the React UI framework and it’s ecosystem.

https://react.dev/

Wormhole

!pico8@programming.dev

Icon base by Skoll under CC BY 3.0 with modifications to add a gradient

Community stats

  • 22

    Monthly active users

  • 46

    Posts

  • 40

    Comments