DEV Community

Discussion on: [Discussion] Managing state in React

Collapse
 
dance2die profile image
Sung M. Kim • Edited

For local or sub-contexts, you can simply use useState/useReducer or Context API.

For global states... it is a heated topic.

To provide a few libraries, I can think of are,

  1. React-Query: Provides hooks and supposedly you don't have to manage "global states" (sorry haven't used this).
  2. Zustand: tiny but easy to use! (redux devtool supported)
  3. Redux Toolkit: created and maintained by Redux team

There are lotcha others (github.com/GantMan/ReactStateMuseum) but check'em out during spare time... Just way too many.