v7 Column TS type is defective ('disableSortBy' does not exist in type 'Column<{}>) #4400
-
react-table version: 7.8.0 If I create the columns object with For example, if we want to disable sort on a particular column, we can pass
I wonder if I am supposed to use other types for columns or the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I figured it out. Long answer: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-table tldr: |
Beta Was this translation helpful? Give feedback.
I figured it out.
Long answer: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/react-table
tldr:
installing the type library
@types/react-table
doesn't mean we are all set with types for react-table. We need to create a file namedreact-table-config.d.ts
in order for types depend upon declaration merging to work well. So depending on what what react-table plugin hooks you want to include, you can play around with the types inreact-table-config.d.ts
to make it give more or less type suggestion for the column or table.You may also need to change
tsconfig.json
to includereact-table-config.d.ts
.