-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge
createActorContext
options with Provider options (#4695)
* Merge createActorContext options with provided options * Changeset * Update packages/xstate-react/src/createActorContext.ts Co-authored-by: Mateusz Burzyński <[email protected]> * Improve test * Oops --------- Co-authored-by: Mateusz Burzyński <[email protected]>
- Loading branch information
1 parent
43fc63b
commit 52900a0
Showing
3 changed files
with
74 additions
and
4 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,18 @@ | ||
--- | ||
'@xstate/react': patch | ||
--- | ||
|
||
Options in `createActorContext` are now properly merged with provider options. Previously, provider options replaced the actor options. | ||
|
||
```tsx | ||
const { inspect } = createBrowserInspector(); | ||
|
||
const SomeContext = createActorContext(someMachine, { inspect }); | ||
|
||
// ... | ||
// Options are now merged: | ||
// { inspect: inspect, input: 10 } | ||
<SomeContext.Provider options={{ input: 10 }}> | ||
{/* ... */} | ||
</SomeContext.Provider>; | ||
``` |
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
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