Created
October 31, 2017 21:50
-
-
Save dounan/8a63e8a63d619dc97d46fac8dcc5b257 to your computer and use it in GitHub Desktop.
Inline function in react example
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 MyComponent extends React.Component { | |
render() { | |
const msg = "Hello " + this.props.user.name.first; | |
return <PureChild onClick={() => this.props.onAlert(msg)} />; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment