我有一个来自 Material-ui 的复选框,它不会触发 onCheck 事件。
<Checkbox
label="label"
onCheck={onCheck}
checked={currentDocument.ispublic}
/>
function onCheck() {
currentDocument.ispublic = !currentDocument.ispublic;
console.log("onCheck");
}
我尝试按照此问题中的描述删除已检查的属性:React Checkbox not sending onChange
currentDocument 是存储在我的商店中的可观察对象。
最佳答案
难道是因为基于https://material-ui-next.com/api/checkbox/#checkbox Material-ui 暴露了 onChange 而不是 onCheck?
关于javascript - 复选框 onCheck 不会触发,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48885894/