-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6450662
commit 4252ee2
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
'xstate': patch | ||
--- | ||
|
||
Generated IDs for invocations that do not provide an `id` are now based on the state ID to avoid collisions: | ||
|
||
```js | ||
createMachine({ | ||
id: 'test', | ||
initial: 'p', | ||
states: { | ||
p: { | ||
type: 'parallel', | ||
states: { | ||
// Before this change, both invoke IDs would be 'someSource', | ||
// which is incorrect. | ||
a: { | ||
invoke: { | ||
src: 'someSource' | ||
// generated invoke ID: 'test.p.a:invocation[0]' | ||
} | ||
}, | ||
b: { | ||
invoke: { | ||
src: 'someSource' | ||
// generated invoke ID: 'test.p.b:invocation[0]' | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}); | ||
``` |