Episode Details
Back to EpisodesReact State Round Up
Description
In this episode of Syntax, Scott and Wes talk about React State libraries, should you use them, pros, cons, and more!
Sanity - SponsorSanity.io is a real-time headless CMS with a fully customizable Content Studio built in React. Get a Sanity powered site up and running in minutes at sanity.io/create. Get an awesome supercharged free developer plan on sanity.io/syntax.
Sentry - SponsorIf you want to know what’s happening with your errors, track them with Sentry. Sentry is open-source error tracking that helps developers monitor and fix crashes in real time. Cut your time on error resolution from five hours to five minutes. It works with any language and integrates with dozens of other services. Syntax listeners can get two months for free by visiting Sentry.io and using the coupon code “tastytreat”.
Show Notes01:24 - Context
- Have we used?
- Scott: Yes
- Wes: Yes
- Pros
- Built into React
- As simple or complex as you want
- Cons
- Takes effort to optimize
- Takes effort to plan and organize aka can get out of hand quickly
08:49 - Redux
- Have we used?
- Scott: Yes
- Wes: Yes
- Pros
- Huge user base
- Legacy of growth and improvements
- Modern API
- Even though it’s hard to learn, it has a clear “how to build with it” path
- Dev tools
- Cons
- Complex
- Thing that calls a thing that calls a thing that calls a thing
- Confusion around what additional packages are needed, e.g. ducks, saga, whatever
17:08 - XState
- Have we used?
- Scott: Yes
- Wes: No
- Pros
- Enforces solid design patterns
- Very safe
- Awesome tooling like UI to see state machines
- https://xstate.js.org/viz/
- Cons
- Knowledge overhead - having to understand state machines
- Complex syntax
23:26 - Zustand
- Have we used?
- Scott: Yes
- Wes: No
- Pros
- Fast, scalable, easy to use
- Simpler
- No context providers
- Cons
- Smaller community 2.6k stars on Github
- Can inform components transiently (with