Packages

xstate

5.33.4 · 7 Nov 2026MIT9M / weekRepositoryHomepagenpmAtom feed

Your version

4.25.0

16 Sep 2021Where it was published

4.38.3 is the newest release of 4.x.

In short

1 new1 fixed

Release note

Minor Changes

  • Removed the ability to pass a model as a generic to createMachine, in favour of model.createMachine. This lets us cut an overload from the definition of createMachine, meaning errors become more targeted and less cryptic.

    This means that this approach is no longer supported:

    const model = createModel({});
    
    const machine = createMachine<typeof model>();

    If you're using this approach, you should use model.createMachine instead:

    const model = createModel({});
    
    const machine = model.createMachine();

Patch Changes

  • Fixed a regression in the inline actions type inference in models without explicit action creators.

    const model = createModel(
      { foo: 100 },
      {
        events: {
          BAR: () => ({})
        }
      }
    );
    
    model.createMachine({
      // `ctx` was of type `any`
      entry: ctx => {},
      exit: assign({
        // `ctx` was of type `unknown`
        foo: ctx => 42
      })
    });

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.