table
table copied to clipboard
sortingFns - myCustomSorting - is not working - @tanstack/react-table v8.7
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
- [X] I agree to follow this project's Code of Conduct
- [X] I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
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.
I have the same issue. It should not be required to have an accessorFn in order to sort.