Skip to content

Instantly share code, notes, and snippets.

@ShMcK
Last active July 23, 2018 14:43
Show Gist options
  • Save ShMcK/68442f00fb4e28c34b1e48d6a97dd7da to your computer and use it in GitHub Desktop.
Save ShMcK/68442f00fb4e28c34b1e48d6a97dd7da to your computer and use it in GitHub Desktop.
state-as-context-render-prop
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