I am using react-table (https://react-table.tanstack.com/) to build a table-like component. Amongst various types of columns few of them are intractable. That means based on the interaction the data(provided to the Table) must be updated. As an example, In the attached screenshot you will notice a column with a type checkbox. Now based on the click to the checkbox, data is also supposed to be updated.
As a solution, I am using the useState
hook and passing the data.
and Updating them onClick event to the checkbox.
This seems a working solution to me, but I found a plugin documented in react-table documentation that implements basic state management for prepared rows and their cells.https://react-table.tanstack.com/docs/api/useRowState As it does not have any working sample associated, I am unable to figure out how this plugin can be used to resolve my current requirement.
Here is the codepen link for the working sample https://codesandbox.io/s/awesome-hill-vz7to?file=/src/App.js