Last active
August 27, 2019 13:32
-
-
Save hdchinh/0d0b7165e607b13a8fd66f13cc1ef720 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
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