Forms

Controlled checkbox checked

Read boolean selection from checked, not value.

Formal Syntax & Structure

react syntaxreact
<input type="checkbox" checked={done} onChange={e => setDone(e.target.checked)} />

Working Example

Example Snippetreact
const [done, setDone] = useState(false);
React Reference