Created
August 11, 2017 16:57
-
-
Save palutz/4e3871fedf2ac03b19ebb287cb35ed11 to your computer and use it in GitHub Desktop.
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
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
class Button extends React.Component { | |
render() { | |
return ( | |
<button> | |
{this.props.text} | |
</button> | |
); | |
} | |
} | |
// defaultProps goes here: | |
Button.defaultProps = { text: 'I am a button'}; | |
ReactDOM.render( | |
// <Button text="" />, / override the default props | |
<Button />, // use the default props | |
document.getElementById('app') | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment