{headerGroup.headers.map(column => (
-
+
{column.render("Header")}
+ {/* Sort direction indicator */}
+
+ {column.isSorted
+ ? column.isSortedDesc
+ ?
+ :
+ : !column.disableSortBy && }
+
))}
diff --git a/types/react-table.config.d.ts b/types/react-table.config.d.ts
new file mode 100644
index 0000000000..ab89ea5113
--- /dev/null
+++ b/types/react-table.config.d.ts
@@ -0,0 +1,120 @@
+import {
+ UseColumnOrderInstanceProps,
+ UseColumnOrderState,
+ UseExpandedHooks,
+ UseExpandedInstanceProps,
+ UseExpandedOptions,
+ UseExpandedRowProps,
+ UseExpandedState,
+ UseFiltersColumnOptions,
+ UseFiltersColumnProps,
+ UseFiltersInstanceProps,
+ UseFiltersOptions,
+ UseFiltersState,
+ UseGlobalFiltersColumnOptions,
+ UseGlobalFiltersInstanceProps,
+ UseGlobalFiltersOptions,
+ UseGlobalFiltersState,
+ UseGroupByCellProps,
+ UseGroupByColumnOptions,
+ UseGroupByColumnProps,
+ UseGroupByHooks,
+ UseGroupByInstanceProps,
+ UseGroupByOptions,
+ UseGroupByRowProps,
+ UseGroupByState,
+ UsePaginationInstanceProps,
+ UsePaginationOptions,
+ UsePaginationState,
+ UseResizeColumnsColumnOptions,
+ UseResizeColumnsColumnProps,
+ UseResizeColumnsOptions,
+ UseResizeColumnsState,
+ UseRowSelectHooks,
+ UseRowSelectInstanceProps,
+ UseRowSelectOptions,
+ UseRowSelectRowProps,
+ UseRowSelectState,
+ UseRowStateCellProps,
+ UseRowStateInstanceProps,
+ UseRowStateOptions,
+ UseRowStateRowProps,
+ UseRowStateState,
+ UseSortByColumnOptions,
+ UseSortByColumnProps,
+ UseSortByHooks,
+ UseSortByInstanceProps,
+ UseSortByOptions,
+ UseSortByState
+} from "react-table";
+
+declare module "react-table" {
+ // take this file as-is, or comment out the sections that don't apply to your plugin configuration
+
+ export interface TableOptions
>
+ extends UseExpandedOptions,
+ UseFiltersOptions,
+ UseGlobalFiltersOptions,
+ UseGroupByOptions,
+ UsePaginationOptions,
+ UseResizeColumnsOptions,
+ UseRowSelectOptions,
+ UseRowStateOptions,
+ UseSortByOptions,
+ // note that having Record here allows you to add anything to the options, this matches the spirit of the
+ // underlying js library, but might be cleaner if it's replaced by a more specific type that matches your
+ // feature set, this is a safe default.
+ Record {}
+
+ export interface Hooks = Record>
+ extends UseExpandedHooks,
+ UseGroupByHooks,
+ UseRowSelectHooks,
+ UseSortByHooks {}
+
+ export interface TableInstance = Record>
+ extends UseColumnOrderInstanceProps,
+ UseExpandedInstanceProps,
+ UseFiltersInstanceProps,
+ UseGlobalFiltersInstanceProps,
+ UseGroupByInstanceProps,
+ UsePaginationInstanceProps,
+ UseRowSelectInstanceProps,
+ UseRowStateInstanceProps,
+ UseSortByInstanceProps {}
+
+ export interface TableState = Record>
+ extends UseColumnOrderState,
+ UseExpandedState,
+ UseFiltersState,
+ UseGlobalFiltersState,
+ UseGroupByState,
+ UsePaginationState,
+ UseResizeColumnsState,
+ UseRowSelectState,
+ UseRowStateState,
+ UseSortByState {}
+
+ export interface ColumnInterface = Record>
+ extends UseFiltersColumnOptions,
+ UseGlobalFiltersColumnOptions,
+ UseGroupByColumnOptions,
+ UseResizeColumnsColumnOptions,
+ UseSortByColumnOptions {}
+
+ export interface ColumnInstance = Record>
+ extends UseFiltersColumnProps,
+ UseGroupByColumnProps,
+ UseResizeColumnsColumnProps,
+ UseSortByColumnProps {}
+
+ export interface Cell = Record, V = any>
+ extends UseGroupByCellProps,
+ UseRowStateCellProps {}
+
+ export interface Row = Record>
+ extends UseExpandedRowProps,
+ UseGroupByRowProps,
+ UseRowSelectRowProps,
+ UseRowStateRowProps {}
+}