Last active
July 23, 2018 14:43
-
-
Save ShMcK/68442f00fb4e28c34b1e48d6a97dd7da to your computer and use it in GitHub Desktop.
state-as-context-render-prop
This file contains hidden or 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
import { State, withStatechart } from 'react-automata' | |
import alarmMachine from './alarmMachine' | |
const AlarmClock = () => ( | |
<State | |
value='Ringing' | |
render={(ringing) => ( | |
<Clock ringing={ringing} /> | |
)} | |
/> | |
) | |
export default withStatechart(alarmMachine)(AlarmClock) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment