Packages

xstate

5.33.4 · 7 Nov 2026MIT9M / weekRepositoryHomepagenpmAtom feed

Your version

5.28.0

12 Feb 2026Where it was published

5.33.4 is the newest release of 5.x.

In short

1 new1 fixed

Release note

Minor Changes

  • Added routable states. States with route: {} and an explicit id can be navigated to from anywhere via a single { type: 'xstate.route', to: '#id' } event.

    const machine = setup({}).createMachine({
      id: 'app',
      initial: 'home',
      states: {
        home: { id: 'home', route: {} },
        dashboard: {
          initial: 'overview',
          states: {
            overview: { id: 'overview', route: {} },
            settings: { id: 'settings', route: {} }
          }
        }
      }
    });
    
    const actor = createActor(machine).start();
    
    // Route directly to deeply nested state from anywhere
    actor.send({ type: 'xstate.route', to: '#settings' });

    Routes support guards for conditional navigation:

    settings: {
      id: 'settings',
      route: {
        guard: ({ context }) => context.role === 'admin'
      }
    }

Patch Changes

  • Export types so setup() declaration emit works (fixes #5462)

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.