Skip to content

Commit

Permalink
changeset spawn input required
Browse files Browse the repository at this point in the history
  • Loading branch information
SandroMaglione committed Dec 9, 2024
1 parent 7dc0b12 commit 9ea95dc
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .changeset/big-pumas-search.md
Original file line number Diff line number Diff line change
@@ -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<typeof childMachine> } },
context: ({ spawn }) => ({
ref: spawn(
childMachine,
// Input is now required!
{ input: { value: 42 } }
)
})
});
```

0 comments on commit 9ea95dc

Please sign in to comment.