Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
const machine = createMachine(/* details elided */);
const Component1 = () => {
const [state, send] = useMachine(machine);
setInterval(() => send({type: 'LOGIN', password: 'foobar'}), 500
return null;
}
const Component1 = () => {
const [state, send] = useMachine(machine);
// will this have the password foobar?
return <div>{state.context.password}</div>;
}
const App = () => {
return (
<div>
<Component1 />
<Component2 />
</div>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment