xstate
5.33.4 · 7 Nov 2026MIT9M / weekRepositoryHomepagenpmAtom feed
Your version
5.33.4 is the newest release of 5.x.
In short
2 new1 fixed
Release note
Minor Changes
waitFor()now accepts a{signal: AbortSignal}inWaitForOptionsThe state value typings for setup state machine actors (
setup({}).createMachine({ ... })) have been improved to represent the actual expected state values.const machine = setup({}).createMachine({ initial: 'green', states: { green: {}, yellow: {}, red: { initial: 'walk', states: { walk: {}, wait: {}, stop: {} } }, emergency: { type: 'parallel', states: { main: { initial: 'blinking', states: { blinking: {} } }, cross: { initial: 'blinking', states: { blinking: {} } } } } } }); const actor = createActor(machine).start(); const stateValue = actor.getSnapshot().value; if (stateValue === 'green') { // ... } else if (stateValue === 'yellow') { // ... } else if ('red' in stateValue) { stateValue; // { // red: "walk" | "wait" | "stop"; // } } else { stateValue; // { // emergency: { // main: "blinking"; // cross: "blinking"; // }; // } }
Patch Changes
The
CallbackLogicFunctiontype (previouslyInvokeCallback) is now exported. This is the callback function that you pass intofromCallback(callbackLogicFn)to create an actor from a callback function.import { type CallbackLogicFunction } from 'xstate'; // ...
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.