mardi 17 novembre 2020

how to pass data as true on check Checkbox for React Material-UI

<FormControlLabel onChange={handleCurrentProjectChange} value="end" control={<Checkbox style= />} label={
                          <Typography style=>
                            Check if project "In Progress"
                          </Typography>
                        }
                        labelPlacement="end"
                  

So here is my Checkbox from Material-UI and I want to create a const bool that allows me to send the data for if the checkbox is checked it sends as "true". I know I need to add a check={ } prop inside of the FormControl but I do not know how to call it.

const HandleProgressCheckbox = (project_in_progress) => {
    setProgressCheckbox({currentProject.project_in_progress ? true : false}),
  };

I tried to get started but this I could be totally wrong. Btw, the checkbox has a label of "project_in_progress". Sorry for my bad explanation skills I hope this is understandable. Help please.




Aucun commentaire:

Enregistrer un commentaire