Skip to content

Instantly share code, notes, and snippets.

@dounan
Created October 31, 2017 21:50
Show Gist options
  • Save dounan/8a63e8a63d619dc97d46fac8dcc5b257 to your computer and use it in GitHub Desktop.
Save dounan/8a63e8a63d619dc97d46fac8dcc5b257 to your computer and use it in GitHub Desktop.
Inline function in react example
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