Skip to content

(TypeScript) Type definitions are incomplete for sortable tables. #2970

@AlexKvazos

Description

@AlexKvazos

Describe the bug (required)
Some type definitions are incomplete -- in the column for example.
Property 'getSortByToggleProps' does not exist on type 'HeaderGroup<object>'.ts(2339)
Property 'isSorted' does not exist on type 'HeaderGroup<object>'.ts(2339)
Property 'isSortedDesc' does not exist on type 'HeaderGroup<object>'.ts(2339)

Provide an example via Codesandbox! (required)
https://codesandbox.io/s/react-table-incomplete-types-x1es6

Steps To Reproduce (required)
Try to use useSortBy on react-table and consume the getSortByToggleProps function or isSorted and isSortedDesc properties on a TypeScript project.

Expected behavior (Recommended)
The types shouldn't error

Screenshots
Screen Shot 2021-01-05 at 20 55 25

This bug was reported without any information before and noticed they were also using TypeScript so I could only figure it was TypeScript specific.
#1481

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions