How to have Sorting Event function to call #2589
-
We are currently using react-data-table-component in our project, but we are in progress to migrate to this one (As this one will allow more control over the UI). One thing I've been struggling with is to replicate the We are creating a new component for the table, and the goal is to get more or less the same signature of the RDTC but using react-table, and creating our own UI components. I have sorting working, but I can't find a way to make this call properly. Ideally what I would like to do, is to create a function with the same signature, as we are using this heavily. I try to hook this with capturing the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
As suggested in the Discord channel: const {
state: {
sortBy
}
} = useTable<T>(
{
columns,
data,
},
useSortBy,
);
useEffect(() => {
onSort(sortBy);
}, [onSort, sortBy]); |
Beta Was this translation helpful? Give feedback.
As suggested in the Discord channel: