Skip to content

Instantly share code, notes, and snippets.

@huang47
Created March 9, 2016 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save huang47/695477e1fa26c4c584d3 to your computer and use it in GitHub Desktop.
Save huang47/695477e1fa26c4c584d3 to your computer and use it in GitHub Desktop.
// 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