-
-
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.
Tweak what options are accepted by
createActorContext
and where (#3814
) * Tweak what options are accepted by `createActorContext` and where * Refactor test * Add changeset * tweak a test title --------- Co-authored-by: David Khourshid <davidkpiano@gmail.com>
- Loading branch information
1 parent
d439fbe
commit 494203b
Showing
5 changed files
with
412 additions
and
47 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,21 @@ | ||
--- | ||
'@xstate/react': minor | ||
--- | ||
|
||
The `Provider` from `createActorContext(...)` now accepts the `options={{...}}` prop that takes the same object as the second argument to the `useMachine(machine, options)` hook. | ||
|
||
These options are no longer passed as the second argument to the `createActorContext(machine)` function: | ||
|
||
```diff | ||
|
||
-const SomeContext = createActorContext(someMachine, | ||
- { actions: { ... } }); | ||
+const SomeContext = createActorContext(someMachine); | ||
|
||
// ... | ||
|
||
-<SomeContext.Provider> | ||
+<SomeContext.Provider options={{ actions: { ... } }}> | ||
|
||
// ... | ||
``` |
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
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
Oops, something went wrong.