In order to react on a checkbox value change, you should:
- Define a function to handle updates:
const handleChange = (e: ChangeEvent<HTMLInputElement>) => {
const { checked } = e.target;
};
- Use this function in the
onChange
attribute:
<input
type="checkbox"
id="remote_work_allowed"
name="remote_work_allowed"
onChange={(e) => handleChange(e)}
/>