Skip to content

Instantly share code, notes, and snippets.

@casprwang
Created March 6, 2017 10:44
Show Gist options
  • Save casprwang/e2952f25d645a05f95e30b17578726a1 to your computer and use it in GitHub Desktop.
Save casprwang/e2952f25d645a05f95e30b17578726a1 to your computer and use it in GitHub Desktop.
class Note extends React.Component {
constructor({age}) {
super()
// {age } = props.age
// this.age = {age}
this.age = {age}
}
componentDidMount(){
}
render() {
return (
<div>
<h1>{this.props.age}</h1>
</div>
)
}
}
ReactDOM.render(
<Note age={22}>
</Note>,
document.getElementById('root'),
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment