Skip to content

Commit

Permalink
Add changeset
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkpiano committed Jun 24, 2021
1 parent 8a1587e commit 38e6a5e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .changeset/grumpy-planes-greet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
'xstate': patch
---

When using a model type in `createMachine<typeof someModel>(...)`, TypeScript will no longer compile machines that are missing the `context` property in the machine configuration:

```ts
const machine = createMachine<typeof someModel>({
// missing context - will give a TS error!
// context: someModel.initialContext,
initial: 'somewhere',
states: {
somewhere: {}
}
});
```

0 comments on commit 38e6a5e

Please sign in to comment.