Describe the bug
I added the manualSorting flag to my table setup to be able to use server side sorting, as stated in the documentation:
Enables sorting detection functionality, but does not automatically perform row sorting. Turn this on if you wish to implement your own sorting outside of the table (eg. server-side or manual row grouping/nesting)
To Reproduce
const {
pageOptions,
previousPage,
nextPage,
state: { pageIndex, pageSize, sortBy },
getTableProps,
getTableBodyProps,
headerGroups,
page,
prepareRow,
canPreviousPage,
canNextPage,
setPageSize,
gotoPage,
} = useTable(
{
columns,
data,
initialState: { pageSize: 10 },
disableMultiSort: true,
manualSorting: true,
},
useSortBy,
usePagination,
);
Expected behavior
As the documentation states, I expect the internal state to be updated but no actual sorting taking place until I manually trigger it.
Desktop (please complete the following information):
Hmmm. Do you have a codesandbox I can look at that exhibits this bug?
Also, make sure you're using the latest version of the library, and take note that manualSorting was renamed to manualSortBy recently.
Sorry for the late reply but renaming the prop to manualSortBy did the trick! Thanks for the help!
can you share an example of how to implement server-side sorting
Most helpful comment
can you share an example of how to implement server-side sorting