Syntax - Tasty Web Development Treats

React State Round Up


Listen Later

In this episode of Syntax, Scott and Wes talk about React State libraries, should you use them, pros, cons, and more!

Sanity - Sponsor

Sanity.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 - Sponsor

If 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 Notes

01: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 (without causing render)

    27:04 - Apollo Client

    • Have we used?
      • Scott: Yes
      • Wes: Yes
    • Pros
      • Fits in well with your GraphQL API
      • Dev tools
    • Cons
      • Complex, large syntax for simple operations
      • Dev tools
      • SSR story is really complex. It’s hard because they aren’t also the framework.

    31:35 - RXJS

    • Have we used?
      • Scott: No
      • Wes: No
    • Observable based

    33:02 - React Query

    • Have we used?
      • Scott: No
      • Wes:
    • Pros
      • Fast growing community
      • Awesome dev tools
    • Cons
      • Not sure if this can be used for application state or just data

    35:37 - Recoil

    • Have we used?
      • Scott: Yes
      • Wes: No
    • Pros
      • Very good for complex, splintered state needs
    • Cons
      • Overly complex for most use cases

    38:34 - MobX

    • Have we used?
      • Scott: No
      • Wes: No
    • Pros
      • Big community
      • Not just React
      • Powerful
      • Observable capabilities
    • Cons
      • Uses decorators, but doesn’t have to?

    43:15 - Easy Peasy

    • Have we used?
      • Scott: No
      • Wes: No
    • Pros
      • Simple API (easy peasy)
      • Redux dev tools supported

    45:06 - Meteor ReactiveDict / ReactiveVar

    • Have we used?
      • Scott: Yes
      • Wes: No
    • Pros
      • Very simple
      • Get, set
      • Is Reactive
    • Cons
      • Lock-in to Meteor

    46:19 - Final Thoughts On State

    • Wes: Go for simpler solutions
    • Scott: I think application state should be separate from application data, but maybe that’s because there isn’t a solution that does both how I want
    Links
    • Svelte
    • Meteor
    • Syntax 206: State Machines, CSS and Animations with David K Piano
    • Syntax 268: Potluck - Beating Procrastination × Rollup vs Webpack × Leadership × Code Planning × Styled Components × More!
    • Zustand CodeSandbox
    • swr
    ××× SIIIIICK ××× PIIIICKS ×××
    • Scott: Becoming Bond
  • Wes: IRWIN VISE-GRIP GrooveLock Pliers Set
  • Shameless Plugs
    • Scott: Modern CSS Design Systems - Sign up for the year and save 25%!
    • Wes: All Courses - Use the coupon code ‘Syntax’ for $10 off!
    Tweet us your tasty treats!
    • Scott’s Instagram
    • LevelUpTutorials Instagram
    • Wes’ Instagram
    • Wes’ Twitter
    • Wes’ Facebook
    • Scott’s Twitter
    • Make sure to include @SyntaxFM in your tweets
    ...more
    View all episodesView all episodes
    Download on the App Store

    Syntax - Tasty Web Development TreatsBy Wes Bos & Scott Tolinski - Full Stack JavaScript Web Developers

    • 4.9
    • 4.9
    • 4.9
    • 4.9
    • 4.9

    4.9

    977 ratings


    More shows like Syntax - Tasty Web Development Treats

    View all
    Software Engineering Radio - the podcast for professional software developers by team@se-radio.net (SE-Radio Team)

    Software Engineering Radio - the podcast for professional software developers

    271 Listeners

    Hanselminutes with Scott Hanselman by Scott Hanselman

    Hanselminutes with Scott Hanselman

    383 Listeners

    The Changelog: Software Development, Open Source by Changelog Media

    The Changelog: Software Development, Open Source

    290 Listeners

    Software Engineering Daily by Software Engineering Daily

    Software Engineering Daily

    623 Listeners

    Talk Python To Me by Michael Kennedy

    Talk Python To Me

    585 Listeners

    Soft Skills Engineering by Jamison Dance and Dave Smith

    Soft Skills Engineering

    289 Listeners

    Thoughtworks Technology Podcast by Thoughtworks

    Thoughtworks Technology Podcast

    43 Listeners

    Python Bytes by Michael Kennedy and Brian Okken

    Python Bytes

    215 Listeners

    The freeCodeCamp Podcast by freeCodeCamp.org

    The freeCodeCamp Podcast

    487 Listeners

    CoRecursive: Coding Stories by Adam Gordon Bell - Software Developer

    CoRecursive: Coding Stories

    189 Listeners

    Practical AI by Practical AI LLC

    Practical AI

    207 Listeners

    The Stack Overflow Podcast by The Stack Overflow Podcast

    The Stack Overflow Podcast

    63 Listeners

    The Real Python Podcast by Real Python

    The Real Python Podcast

    141 Listeners

    PodRocket by LogRocket

    PodRocket

    60 Listeners

    Oxide and Friends by Oxide Computer Company

    Oxide and Friends

    62 Listeners