I want to use this code to store the checkedbox value in workdays and this event is trigger when the check box is onchange
enter code here
const Post = (props) => {
const [workdays, setForma] = React.useState([]);
const handlecheck = (event) => {
let newArray = [...workdays, event.target.value];
if (workdays.includes(event.target.value)) {
newArray = newArray.filter(bhim => bhim !== event.target.value);
}
setForma({workdays:newArray});
}
}