Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

egghead.io

Complex State Management in React with Jotai and XState

via egghead.io

Overview

Jotai's state management is primitive and flexible. This gives you room to build, compose, and share state throughout your application exactly how you need it.
This flexibility can become hard to manage when you have complex requirements that span across a number of states your application can be in.
Jotai lets you leverage other state management solutions through integrations so that you can solve the problem you're facing exactly how you need to.
One of those integrations is XState. XState gives you a safe abstraction to enumerate and handle the complex states your application can be in.
With Jotai + XState, you get the flexibility and ease of use of Jotai with the power of XState.
XState is a sophisticated library to provide a better and safer abstraction for state management.

Syllabus

  • Handle Complex State in Jotai with XState using atomWithMachine
  • Derive Jotai Atom State from Complex State Managed in Xstate
  • Share and Isolate XState State using Jotai Provider
  • Provide XState with Initial Values through Jotai Provider
  • Initialize a Xstate Machine with Jotai Atom in Atom Pattern

Taught by

Daishi Kato

Reviews

4.7 rating at egghead.io based on 7 ratings

Start your review of Complex State Management in React with Jotai and XState

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.