Last active
November 6, 2017 14:29
-
-
Save Siemko/0adebb67c5f8ae154f79b77a76d4835a to your computer and use it in GitHub Desktop.
This file contains 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
class WorkerInfo extends React.Component { | |
state = { worker: null } | |
componentDidMount() { | |
// Simulate fetching data: | |
setTimeout(() => this.setState({ | |
worker: `Hi, I am ${this.props.name} 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