Skip to content

Instantly share code, notes, and snippets.

@akexorcist
Last active March 30, 2020 17:03
Show Gist options
  • Select an option

  • Save akexorcist/70ed1091d3737860d91abf839238550c to your computer and use it in GitHub Desktop.

Select an option

Save akexorcist/70ed1091d3737860d91abf839238550c to your computer and use it in GitHub Desktop.
import React, { Component } from 'react'
...
class UserCard extends Component {
constructor(props) {
super(props);
this.state = {
name: 'Akexorcist'
}
}
onButtonClick() {
console.log('Name : ' + this.state.name)
}
render() {
return (
<div>
...
<button onClick={this.onButtonClick}>Confirm</button>
</div>
)
}
}
export default UserCard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment