diff --git a/.changeset/big-pumas-search.md b/.changeset/big-pumas-search.md new file mode 100644 index 0000000000..9a12e6b814 --- /dev/null +++ b/.changeset/big-pumas-search.md @@ -0,0 +1,22 @@ +--- +'xstate': patch +--- + +Make `spawn` input required when defined inside referenced actor: + +```ts +const childMachine = createMachine({ + types: { input: {} as { value: number } } +}); + +const machine = createMachine({ + types: {} as { context: { ref: ActorRefFrom } }, + context: ({ spawn }) => ({ + ref: spawn( + childMachine, + // Input is now required! + { input: { value: 42 } } + ) + }) +}); +```