Skip to content

Commit

Permalink
Add changeset
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkpiano committed Nov 29, 2020
1 parent ed8592e commit 969a2f4
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .changeset/chatty-monkeys-nail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
'xstate': major
---

An error will be thrown if an `initial` state key is not specified for compound state nodes. For example:

```js
const lightMachine = createMachine({
id: 'light',
initial: 'green',
states: {
green: {},
yellow: {},
red: {
// Forgotten initial state:
// initial: 'walk',
states: {
walk: {},
wait: {}
}
}
}
});
```

You will get the error:

```
No initial state specified for state node "#light.red". Try adding { initial: "walk" } to the state config.
```

0 comments on commit 969a2f4

Please sign in to comment.