#How do I match a child state in a React component?
1 messages · Page 1 of 1 (latest)
1 messages · Page 1 of 1 (latest)
In my component I'm grabbing state like this:
const [state, send] = MachineContext.useActor();
Is there a way to check if state matches a child state like
{humanTurn: "defending"}?
This kind of thing works:
state.matches("humanTurn.attacking")
Either use that or match against a state tag.