From 3d6ded6cd7bd32cd0d997eab17a9b897dd3ec455 Mon Sep 17 00:00:00 2001 From: nixxquality Date: Wed, 10 Oct 2018 21:53:18 +0200 Subject: [PATCH] SortFunction signature should match Array.sort (#29468) -1 and 1 aren't the only numbers allowed. Any number less than or greater than 0 will sort the item properly. This enables shortcuts like (a, b) => a - b; Restricting the signature to -1 | 0 | 1 is a mistake. --- types/react-table/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-table/index.d.ts b/types/react-table/index.d.ts index c58f54eefc..ca7981a6f8 100644 --- a/types/react-table/index.d.ts +++ b/types/react-table/index.d.ts @@ -27,7 +27,7 @@ export type SortedChangeFunction = (newSorted: SortingRule[], column: any, addit export type FilteredChangeFunction = (newFiltering: Filter[], column: any, value: any) => void; export type ExpandedChangeFunction = (column: any, event: any, isTouch: boolean) => void; export type ResizedChangeFunction = (newResized: Resize[], event: any) => void; -export type SortFunction = (a: any, b: any, desc: any) => -1 | 0 | 1; +export type SortFunction = (a: any, b: any, desc: any) => number; export interface Resize { id: string;