autoResetSelectedRows Typescript problem
See original GitHub issueGetting error when giving autoResetSelectedRows option.
Argument of type '{ columns: any; data: any; autoResetSelectedRows: boolean; }' is not assignable to parameter of type 'TableOptions<object>'.
Object literal may only specify known properties, and 'autoResetSelectedRows' does not exist in type 'TableOptions<object>'.ts(2345)
This is documented feature https://react-table.tanstack.com/docs/api/useRowSelect Why I’m getting this error?
Code sample:
const {
getTableProps,
getTableBodyProps,
headerGroups,
rows,
prepareRow,
state: { pageIndex, pageSize, selectedRowIds },
} = useTable(
{
columns,
data,
autoResetSelectedRows: false,
},
useFlexLayout,
useRowSelect
);
Issue Analytics
- State:
- Created 3 years ago
- Comments:7
Top Results From Across the Web
autoResetSelectedRows Typescript problem #2697 - GitHub
Getting error when giving autoResetSelectedRows option. Argument of type '{ columns: any; data: any; autoResetSelectedRows: boolean; } ...
Read more >Typescript taking in Javascript component; How to solve errors
Update based on answer. Using the new allow JS, i still am receiving a similar error as below, Type '{ columns: MutableRefObject< ...
Read more >react-table useRowSelect TypeScript Examples
This page shows TypeScript code examples of react-table useRowSelect.
Read more >tannerlinsley/react-table: kitchen-sink - CodeSandbox
skipReset,\n autoResetSelectedRows: ! ... \"https:\u002F\u002Fregistry.yarnpkg.com\u002F@babel\u002Fpreset-typescript\u002F-\u002Fpreset-typescript-7.6.0.
Read more >[Solved]-React Table - radio input for useRowSelect-Reactjs
Coding example for the question React Table - radio input for useRowSelect-Reactjs. ... Pass autoResetSelectedRows: false, to useTable function.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Again, this library does not ship with native types (yet). So use any community types at your own risk.
While we do not use that functionality ourselves, a quick check would seem to confirm that to type check the custom function, you need to add it to the “TableOptions” interface in the configuration file, i.e.: