Skip to content

Instantly share code, notes, and snippets.

@ShMcK
Last active September 23, 2018 21:58
Show Gist options
  • Save ShMcK/6441a84d1ba701583cf22bab4edd3f67 to your computer and use it in GitHub Desktop.
Save ShMcK/6441a84d1ba701583cf22bab4edd3f67 to your computer and use it in GitHub Desktop.
xstateful-react-provider
import * as React from 'react'
import { Display, Time } from './components'
import ClockMachine from './Machine'
export default class Clock extends React.Component {
render() {
return (
<ClockMachine.Provider>
<ClockMachine.Control onDidMount={this.init}>
<Display>
<Time />
</Display>
</ClockMachine.Control>
</ClockMachine.Provider>
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment