React Checkbox not sending onChange

后端 未结 7 1385
夕颜
夕颜 2020-12-04 16:19

TLDR: Use defaultChecked instead of checked, working jsbin.

Trying to setup a simple checkbox that will cross out its label text when it is checked. For some reason

7条回答
  •  自闭症患者
    2020-12-04 16:30

    onChange will not call handleChange on mobile when using defaultChecked. As an alternative you can can use onClick and onTouchEnd.

    ;
    

提交回复
热议问题