Answer the question
In order to leave comments, you need to log in
How to select all checkboxes in react?
There is a page with checkboxes that have name={'names'} and onChange={handleClickCheckbox}.
This is how I collect data from checkboxes
const [names, setNames] = useState([]);
const handleClickCheckbox = (e) => {
const formData = new FormData(e.currentTarget.form);
const names = formData.getAll('names');
setNames(names);
}
Answer the question
In order to leave comments, you need to log in
Either a binding, or choose from the house by the filter and draw them
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question