Last active
February 14, 2019 21:23
-
-
Save QMaximillian/05d24b87cf421498cd1b0fb19b791637 to your computer and use it in GitHub Desktop.
Render Prop - Hello
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
const word = 'hello'; | |
class Hello extends React.Component { | |
state={loud: false} | |
handleLoudness = () => { | |
this.setState({ | |
loud: !this.state.loud | |
}) | |
} | |
render() { | |
return ( | |
<div> | |
{this.props.render({ | |
handleLoudness: this.handleLoudness, | |
loud: this.state.loud,word: word })} | |
</div> | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment