xstate
5.33.4 · 7 Nov 2026MIT9M / weekRepositoryHomepagenpmAtom feed
4.38.3 is the newest release of 4.x.
In short
3 new5 fixed
Release note
Minor Changes
The types for the
send()andsendParent()action creators have been changed to fix the issue of only being able to send events that the machine can receive. In reality, a machine can and should send events to other actors that it might not be able to receive itself. See #711 for more information.Previously,
state.matches(...)was problematic because it was castingstatetoneverif it didn't match the state value. This is now fixed by making theTypestateresolution more granular.Actions from a restored state provided as a custom initial state to
interpret(machine).start(initialState)are now executed properly. See #1174 for more information.
Patch Changes
Fix passing state schema into State generic
Fixed an issue with invoked service not being correctly started if other service got stopped in a subsequent microstep (in response to raised or null event).
Delayed transitions defined using
afterwere previously causing a circular dependency when the machine was converted using.toJSON(). This has now been fixed.Fixed an issue with
chooseandpurenot being able to use actions defined in options.XState will now warn if you define an
.onDonetransition on the root node. Root nodes which are "done" represent the machine being in its final state, and can no longer accept any events. This has been reported as confusing in #1111.
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.