Skip to content

Instantly share code, notes, and snippets.

Last active Nov 6, 2017
What would you like to do?
class WorkerInfo extends React.Component {
state = { worker: null }
componentDidMount() {
// Simulate fetching data:
setTimeout(() => this.setState({
worker: `Hi, I am ${} and I am proud to work for ${this.props.employer}`
}), 2500);
render() {
return this.props.children(this.state.worker);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment