xstate
5.33.4 · 7 Nov 2026MIT9M / weekRepositoryHomepagenpmAtom feed
4.38.3 is the newest release of 4.x.
In short
1 new7 fixed
Release note
Minor Changes
Added a
StateValueFromhelper that can be used to extract valid state values from a machine. This might specifically be useful with typegen because typegenlessstate.matchesacceptsanyanyway.
Patch Changes
Removing the timeout that's built in to
waitForis now supported by explicitly passing anInfinityvalue.Example usage:
import { waitFor } from 'xstate/lib/waitFor'; // This will const loggedInState = await waitFor( loginService, state => state.hasTag('loggedIn'), { timeout: Infinity } );This fixes a bug that causes
waitForto reject with an error immediately due to the behaviour ofsetTimeout.Fixed an issue with typegen types not being able to provide events that had a union of strings as their
type(such as{ type: 'INC' | 'DEC'; value: number; }).Fixed an issue with
EventFromnot being able to extract events that had a union of strings as theirtype(such as{ type: 'INC' | 'DEC'; value: number; }).Fixed an issue with action objects not receiving correct event types when used in the second argument to the
createMachine.The typings for
sendTo(...)have been fixed.Fixed an issue with inline functions in the config object used as transition actions not having their argument types inferred.
Fixed an issue with default
TEvent({ type: string }) not being correctly provided to inline transition actions.
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.