The Death of the Global Store
Five years ago, every project started with an argument about Redux vs. MobX. Today, those arguments are largely irrelevant. Modern React development has moved toward "state localization" and server-driven data.
Use the Server for Server State
90% of what we used to put in global stores was just cached data from the server. With Next.js App Router and Server Components, that state belongs on the server.
- Server-Side Fetching: Fetching where you use it.
- Cache Tags: Leveraging Next.js
revalidateTagfor surgical cache updates.
Reactive Context & State
For the remaining 10%—the UI state—we find that native useContext paired with useReducer or simple useState is more than enough for even the most complex enterprise dashboards.
- Keep it Local: State should live as close to where it's consumed as possible.
- Atomic Updates: If a piece of state doesn't need to be global, don't make it global.
- Zustand for the Gaps: When we absolutely need a global store, we use ultra-lightweight solutions like Zustand that don't require boilerplate.
Why Complexity Fails
Complex state management creates "locked" codebases that are difficult to refactor. By following the "Simple State" philosophy, Nextcraft builds products that are cheaper to maintain and faster to iterate on.
The goal isn't to manage state; the goal is to make state unnecessary.