You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
#3814494203b3d Thanks @Andarist! - 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:
#379951d254692 Thanks @Andarist! - Fixed an issue that caused the internally used useSyncExternalStore to warn about the computed snapshot not being cached when a not-started machine servive was passed to useActor.
#3778f12248b23 Thanks @davidkpiano! - The createActorContext(...) helper has been introduced to make global actors easier to use with React. It outputs a React Context object with the following properties:
.Provider - The React Context provider
.useActor(...) - A hook that can be used to get the current state and send events to the actor
.useSelector(...) - A hook that can be used to select some derived state from the actor's state
.useActorRef() - A hook that can be used to get a reference to the actor that can be passed to other components
Usage:
import{createActorContext}from'@​xstate/react';import{someMachine}from'./someMachine';// Create a React Context object that will interpret the machineconstSomeContext=createActorContext(someMachine);functionSomeComponent(){// Get the current state and `send` functionconst[state,send]=SomeContext.useActor();// Or select some derived stateconstsomeValue=SomeContext.useSelector((state)=>state.context.someValue);// Or get a reference to the actorconstactorRef=SomeContext.useActorRef();return(/* ... */);}functionApp(){return(<SomeContext.Provider><SomeComponent/></SomeContext.Provider>);}
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
If you want to rebase/retry this PR, check this box
This PR has been generated by Mend Renovate. View repository job log here.
ℹ️ The type check failures seem to occur because @xstate/react relies on instantiation expressions introduced with TypeScript 4.7. Kibana is still on TypeScript 4.6.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^3.0.2
->^3.2.1
^4.35.2
->^4.37.1
Release Notes
statelyai/xstate
v3.2.1
Compare Source
Patch Changes
c110c429d
Thanks @Andarist! - Fixed compatibility of the generated TS types forcreateActorContext
with pre-4.7.v3.2.0
Compare Source
Minor Changes
#3814
494203b3d
Thanks @Andarist! - TheProvider
fromcreateActorContext(...)
now accepts theoptions={{...}}
prop that takes the same object as the second argument to theuseMachine(machine, options)
hook.These options are no longer passed as the second argument to the
createActorContext(machine)
function:v3.1.2
Compare Source
Patch Changes
b53856d28
Thanks @farskid! - Interpreter options can now be specified in the second argument of createActorContext(machine, options).v3.1.1
Compare Source
Patch Changes
51d254692
Thanks @Andarist! - Fixed an issue that caused the internally useduseSyncExternalStore
to warn about the computed snapshot not being cached when a not-started machine servive was passed touseActor
.v3.1.0
Compare Source
Minor Changes
#3778
f12248b23
Thanks @davidkpiano! - ThecreateActorContext(...)
helper has been introduced to make global actors easier to use with React. It outputs a React Context object with the following properties:.Provider
- The React Context provider.useActor(...)
- A hook that can be used to get the current state and send events to the actor.useSelector(...)
- A hook that can be used to select some derived state from the actor's state.useActorRef()
- A hook that can be used to get a reference to the actor that can be passed to other componentsUsage:
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
This PR has been generated by Mend Renovate. View repository job log here.