Skip to content

Instantly share code, notes, and snippets.

@kocisov
Last active May 1, 2017 16:21
Show Gist options
  • Save kocisov/5f244fd5da33049de91120585166ecad to your computer and use it in GitHub Desktop.
Save kocisov/5f244fd5da33049de91120585166ecad to your computer and use it in GitHub Desktop.
xd
// That first component lul
...
render() {
return (
...
<Notification error={this.state.error} success={this.state.success} />
...
)
}
// Notification component
export default ({ error, success }) =>
<div>
New notification: {error.message}!
New notification: {success.message}!
</div>
// or class
export default class Notification extends Component {
render() {
return (
<div>
New notification: {this.props.error.message}!
New notification: {this.props.success.message}!
</div>
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment