javascript - React checkedLink how to access value on change -
i using react write simple component checkbox
<input type="checkbox" checkedlink={this.linkstate('checkedvalue')} />
i cannot figure out code gets triggered on change of checkbox value. supposed retrieve value onfocus or there better convention retrieving value after change.
you grab state of checkbox adding onchange
handler this:
function handlechange (event) { console.log(event.target.checked) } <input onchange={handlechange} type='checkbox' />
Comments
Post a Comment