xstate
5.33.4 · 7 Nov 2026MIT9M / weekRepositoryHomepagenpmAtom feed
4.38.3 is the newest release of 4.x.
In short
4 new4 fixed
Release note
Minor Changes
A new
predictableActionArgumentsfeature flag has been added that allows you to opt into some fixed behaviors that will be the default in v5. With this flag:XState will always call an action with the event directly responsible for the related transition,
you also automatically opt-into
preserveActionOrder.
Please be aware that you might not able to use
statefrom themetaargument when using this flag.All
exitactions in the machine will now be correctly resolved and executed when a machine gets stopped or reaches its top-level final state. Previously, the actions were not correctly resolved and that was leading to runtime errors.To implement this fix in a reliable way, a new internal event has been introduced:
{ type: 'xstate.stop' }and when the machine stops its execution, all exit handlers of the current state (i.e. the active state nodes) will be called with that event. You should always assume that an exit handler might be called with that event.
Patch Changes
Added a dev-only error when
forwardToaccidentally ends up trying to forward an event to an undefined actor. Such a situation indicates a logical error and risks an infinite loop.Call the
completecallback of the subscribedobserverwhen an interpreter gets stopped.Fixed an issue with parallel regions not always being correctly reentered on external transitions of the containing parallel state targeting another region within that parallel state.
The types for
state.nextEventsare now properly typed to the actual event types of the machine. Original PR: #1115 (Thanks @alexreardon!)Fixed an issue with targeted ancestors not being correctly reentered during external transitions.
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.