Skip to content

Can context input be used with @xstate/react's useMachine and/or useActor hooks? #5130

Answered by davidkpiano
cmh-echomark asked this question in Q&A
Discussion options

You must be logged in to vote

Your code should look like this:

const [snapshot, send] = useMachine(localMachine, {
  input: { guid: '464...' }
});

Is there a reason that the above pattern does not work for your use-case?

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@cmh-echomark
Comment options

Answer selected by cmh-echomark
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants