TanStackT
TanStack4y ago
6 replies
conventional-black

Selecting checkbox not updating row selection state

I'm trying to add a select all option to my table like: https://codesandbox.io/s/github/tanstack/table/tree/main/examples/react/row-selection?from-embed=&file=/src/main.tsx

But it looks like checking my checkboxes isn't updating the setRowSelection state as logging the rowSelection always returns an empty object.

I've attached screenshots of the relevant code below. Do I need to manually call setRowSelection anywhere other than in the useReactTable?
Screenshot_2022-09-29_at_11.42.57.png
Screenshot_2022-09-29_at_11.43.22.png
Screenshot_2022-09-29_at_11.43.59.png
CodeSandbox
tanstack-table-example-row-selection using @faker-js/faker, @tanstack/react-table, react, react-dom
tanstack-table-example-row-selection - CodeSandbox
Was this page helpful?