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
{{ message }}
This repository has been archived by the owner on Mar 5, 2023. It is now read-only.
In xstate, withConfig is typed with context as a second, optional parameter. In xstate-codegen, the generated signature for withConfig lets you pass in context in the same object as the rest of the machine options. This ends up getting silently ignored and leads to confusing behavior.
The generated machines are also missing the withContext method. Typescript uses the original xstate method, which results in a type error because it returns the StateMachine type from xstate and not the generated machine type from xstate-codegen.
The text was updated successfully, but these errors were encountered:
In xstate,
withConfig
is typed with context as a second, optional parameter. In xstate-codegen, the generated signature forwithConfig
lets you pass in context in the same object as the rest of the machine options. This ends up getting silently ignored and leads to confusing behavior.The generated machines are also missing the
withContext
method. Typescript uses the original xstate method, which results in a type error because it returns theStateMachine
type from xstate and not the generated machine type from xstate-codegen.The text was updated successfully, but these errors were encountered: