I make table contain students names, and checkbox for every row in the table, I want so store the students names that checked in the (students) array. How can I do that?
const [data, setData] = useState([]);
const [students, setStudents] = useState([]);
useEffect(() => {
Axios
.get("http://localhost:3003/studentsnotinsections")
.then(result => setData(result.data));
}, []);
console.log(students)
return(
<div>
<table className="table" >
<thead className="thead-dark">
<tr>
<th scope="col">Name</th>
</tr>
</thead>
<tbody>
{data.map((item, id) => {
return <tr key={id}>
<td>{item.FullName}</td>
<td><input type="checkbox" /></td>
</tr>
})}
</tbody>
</table>
</div>
)}