DEV Community

Cover image for Is Redux DEAD? Try Zustand!
Marius Espejo
Marius Espejo

Posted on

 

Is Redux DEAD? Try Zustand!

With the advent of hooks a lot of ReactJS developers have moved away from Redux as the default state management of choice.

However is simply using useState, useReducer, and the context API good enough? I highly recommend checking out Zustand! Dead simple and unopinionated state management!

Zustand is a small, fast and scaleable bearbones state-management solution. Has a comfy api based on hooks, isn't boilerplatey or opinionated, but still just enough to be explicit and flux-like.

In this video we're going to walk through the basics of using Zustand. We'll also discuss the pros and cons of this approach compared to reducer-based and context-based solutions like the useReducer hook and Redux.

Let me know what you think of Zustand!

Top comments (1)

Collapse
 
marius profile image
Marius Espejo

As a follow up, I also explored Jotai recently:

11 Tips That Make You a Better Typescript Programmer

typescript

1 Think in {Set}

Type is an everyday concept to programmers, but it’s surprisingly difficult to define it succinctly. I find it helpful to use Set as a conceptual model instead.

#2 Understand declared type and narrowed type

One extremely powerful typescript feature is automatic type narrowing based on control flow. This means a variable has two types associated with it at any specific point of code location: a declaration type and a narrowed type.

#3 Use discriminated union instead of optional fields

...

Read the whole post now!