Skip to content

Commit 6ebf318

Browse files
gargrohtannerlinsley
authored andcommitted
[useSort] Add sort order custom sortMethod (TanStack#1615)
Added sort order as parameter for calling sortMethod(will be useful to provide more control in custom sortMethod)
1 parent 5778bc3 commit 6ebf318

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/plugin-hooks/useSortBy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ function useInstance(instance) {
296296

297297
// Return the correct sortFn.
298298
// This function should always return in ascending order
299-
return (a, b) => sortMethod(a, b, sort.id)
299+
return (a, b) => sortMethod(a, b, sort.id, sort.desc)
300300
}),
301301
// Map the directions
302302
availableSortBy.map(sort => {

0 commit comments

Comments
 (0)