diff --git a/docs/guides/nested-states.md b/docs/guides/nested-states.md index b9524db78..0fd59cdca 100644 --- a/docs/guides/nested-states.md +++ b/docs/guides/nested-states.md @@ -72,7 +72,8 @@ Here we create a `nested` function that defines a submachine. ```js // A helper function for more easily building nested state machines. -const nested = (to, states) => createMachine(states, +const nested = (to, states) => invoke( + createMachine(states), transition('done', to) ); @@ -90,4 +91,4 @@ const stoplight = createMachine({ dontWalk: final() }) }); -``` \ No newline at end of file +```