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
Bug: [Typescript] Failing to declare first parameter of guard breaks type inference in enqueueActions if another guard accepts dynamic parameters
#5014
XState version
XState version 5
Description
Hi, love XState - just ported my teams typescript clients to XState, and came across this bug I think you might find interesting.
Parameter inference seems to break if you have:
()
vs(_)
(_, params: { some: string )})
This results in a typescript error on the action along the lines of, indicating that parameter type inference broke.
Workaround is always declaring the first parameter of all guards, even if unused.
@Andarist
Expected result
No type error.
Actual result
Type error.
Reproduction
https://stackblitz.com/edit/vitejs-vite-dwgz2w?file=src%2Fmain.ts&view=editor
Additional context
v5.16.0
The text was updated successfully, but these errors were encountered: