Skip to content

Instantly share code, notes, and snippets.

@hdchinh
Last active August 27, 2019 13:32
Show Gist options
  • Save hdchinh/0d0b7165e607b13a8fd66f13cc1ef720 to your computer and use it in GitHub Desktop.
Save hdchinh/0d0b7165e607b13a8fd66f13cc1ef720 to your computer and use it in GitHub Desktop.
import React from 'react';
class App extends React.Component {
handleClick = (e, data) => {
console.log(data);
}
render() {
const data = 10;
const data2 = 20;
return(
<div>
<input type="checkbox" value={data} defaultChecked={false} onClick={((e) => this.handleClick(e, data))}/>
<input type="checkbox" value={data2} defaultChecked={false} onClick={((e) => this.handleClick(e, data2))}/>
</div>
)
}
}
export default App;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment