Checkbox always shows true in ReactJS only on production -
so have specific issues. have checkbox controlled component , works fine on local machine, when push code online, works (check/uncheck), data ok "0" , "1", checkbox checked. knows might cause of problem?
https://gist.github.com/sasafister/3f6d555432986a74e37f113685720a6d
here code
<input classname="float-right" type="checkbox" defaultchecked={course.is_featured} onchange={this.togglechecked.bind(this, course.id)} />
if using controlled input must have value/checked
, onchange
handler. defaultchecked
initial load , not updatable.
<input classname="float-right" type="checkbox" checked={course.is_featured} onchange={this.togglechecked.bind(this, course.id)} />
Comments
Post a Comment