| 8 | const Title = () => <h1>Hello there!</h1>; |
| 9 | |
| 10 | class DataProvider extends React.Component { |
| 11 | constructor(props) { |
| 12 | super(props); |
| 13 | |
| 14 | this.state = { data: null }; |
| 15 | setTimeout(() => this.setState({ data: 'Hey there!' }), 5000); |
| 16 | } |
| 17 | render() { |
| 18 | if (this.state.data === null) return null; |
| 19 | return <section>{ this.props.render(this.state.data) }</section>; |
| 20 | } |
| 21 | } |
| 22 | DataProvider.propTypes = { |
| 23 | render: PropTypes.func |
| 24 | }; |
nothing calls this directly
no outgoing calls
no test coverage detected