You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description StateMachine.withConfig() returns a StateNode instead of a StateMachine. This breaks interpreter inference.
import{createMachine,interpret}from'xstate'interfaceContext{}typeEvent={type: 'EVENT'}constmachine=createMachine<Context,Event>({})constinterpreter1: InterpreterFrom<typeofmachine>=interpret(machine)// @ts-expect-error Event object is not inferred properly for the Interpreterconstinterpreter2: InterpreterFrom<typeofmachine>=interpret(machine.withConfig({}))
Description
StateMachine.withConfig()
returns aStateNode
instead of aStateMachine
. This breaks interpreter inference.Reproduction
https://codesandbox.io/s/machinewithcontext-returns-a-statenode-type-instead-of-a-statemachine-type-k2mxk
Fix?
The text was updated successfully, but these errors were encountered: