Skip to content

Commit afaedf3

Browse files
Sean PrashadSean Prashad
authored andcommitted
Add id's to data source
1 parent 180e201 commit afaedf3

File tree

2 files changed

+170
-4
lines changed

2 files changed

+170
-4
lines changed

web/src/components/Table/index.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,17 @@ const Table = () => {
2929
columns: [
3030
{
3131
id: 'Checkbox',
32-
Cell: rowInfo => {
32+
Cell: cellInfo => {
3333
return (
3434
<input
3535
type="checkbox"
3636
className="checkbox"
37-
name={rowInfo.row.original.name}
38-
checked={checked[rowInfo.row.id]}
37+
name={cellInfo.row.original.name}
38+
checked={checked[cellInfo.row.original.id]}
3939
onChange={() => {
40-
checked[rowInfo.row.id] = !checked[rowInfo.row.id];
40+
checked[cellInfo.row.original.id] = !checked[
41+
cellInfo.row.original.id
42+
];
4143
setChecked([...checked]);
4244
}}
4345
/>

0 commit comments

Comments
 (0)