Bug: typegen causes type error when a service
is a function returning a StateMachine which has Context
#379
Labels
bug
Something isn't working
Description
When an entry in the
services
part of the machine definition is a function returning a state machine which has context, I get a type error.Consider the following machine defintions:
Expected result
There should be no error on the "invoke child machine" service binding line.
Actual result
There is an error:
Reproduction
Unfortunately, I can't do that because typegen doesn't run in CodeSandbox.
Additional context
NOTE: The error only happens if the child state machine has context and is instantiated via a function.
This works:
and this works:
Tested with XState version 4.38.2
The text was updated successfully, but these errors were encountered: