endless-jadeE
Refine3y ago
11 replies
endless-jade

Reset sorting for useTable

I have a reset button, which I am using to reset the sorting on the table. Btw I am also doing multiple sorting over my table.

I am using setSorter return by useTable hook. When I click on the reset button, I am calling setSorter and setting the sorter state to blank array. The sorting works, as it refetches the data,however, it looks like the sorting params withtin the Table component is not getting updated. When I go back to sorting the table with any of the fields, it is still making use of the previous sort fields it had prior to the reset, in addition to the new field being sorted.
Was this page helpful?