Last active
May 1, 2017 16:21
-
-
Save kocisov/5f244fd5da33049de91120585166ecad to your computer and use it in GitHub Desktop.
xd
This file contains hidden or 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
// 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