Zustand Officially Dethrones Redux

The React state management landscape has a new leader: Zustand has officially surpassed Redux in npm downloads. The shift signals a strong community preference for Zustand's minimal API, TypeScript-first design, and lack of boilerplate compared to the more traditional Redux setup.

Redux, created by Dan Abramov and Andrew Clark in 2015, was inspired by Facebook's Flux architecture and aimed to provide a predictable state container for JavaScript applications. It quickly became the standard for large-scale React applications, centralizing the application's state and logic. Mark Erikson and Tim Dorr have been the primary maintainers since mid-2016. Zustand, which means "state" in German, was created by the developers behind Jotai and aims for simplicity and minimal boilerplate. It offers a hook-based API that feels more native to modern React development and doesn't require wrapping the application in a context provider. The key difference lies in their approach to boilerplate and bundle size. Zustand has a significantly smaller footprint, coming in at around 1-4KB, whereas Redux, even with the recommended Redux Toolkit, is larger. This has made Zustand a popular choice for performance-sensitive applications and smaller to medium-sized projects. While Redux's strict, centralized structure is beneficial for very large applications with complex state interactions, Zustand's flexibility is often preferred for faster development cycles. However, both libraries support Redux DevTools for debugging, a critical feature for managing complex application states. The rise of React Hooks fundamentally shifted state management patterns, creating an opening for libraries like Zustand that are built around them. Additionally, the distinction between client-side and server-side state has become more pronounced, with libraries like React Query often being used alongside a global state manager to handle asynchronous data fetching, a task for which Redux was often used but not specifically designed. For engineering managers, the choice between Zustand and Redux often depends on team size and project complexity. Redux's established patterns and extensive documentation can be advantageous for large, distributed teams, while Zustand's lower learning curve and reduced boilerplate can increase velocity for smaller, more agile teams.

Get your own daily briefing

Scout delivers personalized news, insights, and conversations tailored to your role and industry.

Download on the App Store

Shared from Scout - Be the smartest in the room.