Checkbox false to true

i have this checkbox in my form

     type="checkbox"
     value={wpp}
     name="wpp"
     onChange={(e) => setWpp(e.target.value)}
     /> 

and i defined like

const [wpp, setWpp] = useState(false);

how do I do when someone selects this checkbox to be sent to my database as true?

Answer

In the case of the checkbox you need to watch for the checked property

type="checkbox"
     checked={wpp}
     name="wpp"
     onChange={(e) => setWpp(e.target.checked)}
     />