Skip to content

(Invalid) Can't use useActor to interpret a spawned machine #1488

Discussion options

You must be logged in to vote

It was a React typo, unrelated to XState:

-const Alarm = (alarm) => {
+const Alarm = ({ alarm }) => {
  const [state, send] = useActor(alarm);
  console.log(state, send);
  return <p>I'm an Alarm</p>;
};

You'll see it works with those changes.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@DirkWolthuis
Comment options

Comment options

You must be logged in to vote
1 reply
@DirkWolthuis
Comment options

Answer selected by davidkpiano
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants