Created
March 9, 2016 17:19
-
-
Save huang47/695477e1fa26c4c584d3 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
// classic component | |
class HelloMessage extends React.Component { | |
render() { | |
return <div>Hello {this.props.name}</div>; | |
} | |
} | |
// stateless component | |
const HelloMessage = (props) => { | |
return <div>Hello {props.name}</div>; | |
} | |
ReactDOM.render(<HelloMessage name="world" />, mountNode); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment