npm / @xstate/react
@xstate/react
What changed in @xstate/react 5 to 6, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-20.
4 breaking1 new APIs and options
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@xstate/react 62 changes
Breaking changes 2
useActor now throws when the actor reaches an error state, allowing errors to be caught by React error boundaries.
useSelector now throws when the actor reaches an error state, allowing errors to be caught by React error boundaries.
@xstate/react 53 changes
Breaking changes 2
Pass a machine with provided implementations directly as the first argument to useMachine(), useActor(), or useActorRef(); these hooks no longer accept lazy machine creators or implementations as a second argument.
Now accepts actor logic instead of an existing ActorRef; use useSelector(actor, ...) to read an existing actor’s snapshot.
New APIs and options 1
Replaces the useInterpret() hook for returning an actor reference.