table
table copied to clipboard
getHeaderProps override “click” sortMethod with in react-table
I am using getHeaderProps, I have to change some state when i click on header of react-table,On that click my sortMethod should also work. But its not working.
So On using getHeaderProps, onClick overrides the sortMethod onClick, Therefore sortMethod not working, only getHeaderProps onclick workes.
Now I have Send handleOriginal in onClick as 2nd Parameter but i receive always undefined.
getHeaderProps: (state, rowInfo, column, instance) => {
return {
onClick: (event, handleOriginal) => {
customHeaderSort('conversationStartTime');
if (handleOriginal) { // always undefiend
handleOriginal();
}
},
};
},
},
sortMethod: (current, next) => {
return tableDataComparator(current, next);
},
v6 is no longer being actively maintained. I would suggest asking this question or bringing up this issue in the community forum for more help: https://spectrum.chat/react-table