How can I set an onClick-Function to my table-header without removing the sort function (useSortBy) which will be executed by clicking the Header. Here is my code:
function renderTableHeader() {
const headers = headerGroups.map(headerGroup => {
return (
<tr {...headerGroup.getHeaderGroupProps()}>
{headerGroup.headers.map(column => (
<th
{...column.getHeaderProps(
column.sortable && column.getSortByToggleProps()
)}
>
{(column.render("Header")}
<span>
<i className={determineSortState(column)} />
</span>
</th>
))}
</tr>
);
});