Open xylophonehero opened 3 months ago
XState version 5
When calling spawnChild in the actions of an event, the input function does not filter to just the event but rather all events in the schema
const myMachine = setup({ types: {} as { context: TranscriptionsMachineContext events:{ type: 'foo'; value: string } | { type: 'bar' } }, }).createMachine({ on: { foo: { actions: spawnChild('myActor', { input: ({event}) => event.value // HERE }) } } })
event.value should be fine to access
event.value is not accessible as the event could be anything event in the schema, not just foo
foo
https://codesandbox.io/p/devbox/wizardly-solomon-7vskzv?file=%2Fsrc%2FfeedbackMachine.ts%3A46%2C16
No response
XState version
XState version 5
Description
When calling spawnChild in the actions of an event, the input function does not filter to just the event but rather all events in the schema
Expected result
event.value should be fine to access
Actual result
event.value is not accessible as the event could be anything event in the schema, not just
foo
Reproduction
https://codesandbox.io/p/devbox/wizardly-solomon-7vskzv?file=%2Fsrc%2FfeedbackMachine.ts%3A46%2C16
Additional context
No response