TanStack / table

🤖 Headless UI for building powerful tables & datagrids for TS/JS - React-Table, Vue-Table, Solid-Table, Svelte-Table
https://tanstack.com/table
MIT License
25.02k stars 3.07k forks source link

sortingFns - myCustomSorting - is not working - @tanstack/react-table v8.7 #4591

Open jeevasusej opened 1 year ago

jeevasusej commented 1 year ago

Describe the bug

Implemented custom sort but not working as described in the document.

https://tanstack.com/table/v8/docs/api/features/sorting?from=reactTableV7&original=https://react-table-v7.tanstack.com/docs/api/useSortBy

Your minimal, reproducible example

https://codesandbox.io/s/eloquent-wilson-izkkgl

Steps to reproduce

Followed the steps as explained in the document.

https://tanstack.com/table/v8/docs/api/features/sorting?from=reactTableV7&original=https://react-table-v7.tanstack.com/docs/api/useSortBy

Expected behavior

The two state (2 state) sorting should work. But the function is not called and didn't work as expected.

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

React

react-table version

8.7.0

TypeScript version

4.7.4

Additional context

No response

Terms & Code of Conduct

cgriebel commented 1 year ago

I also have this issue. Providing an accessorFn in the column definition fixes it but it seems like that shouldn't be required, in my case I'm using a custom cell component because the value for the column is an array.

redsuperbat commented 11 months ago

I have the same issue. It should not be required to have an accessorFn in order to sort.