I am following the example here Codesandbox Example and by default I can sort each column by clicking on each header. If I have a table like the following:
score | firstName | lastName | ||
---|---|---|---|---|
6 | Anne | Faith | ||
10 | Bob | Smith | ||
I want to sort them using a separate dropdown component with options:
- Sort score from high to low
- Sort score from low to high
- Sort first name from high to low
- Sort first name from low to high
- Sort last name from high to low
- Sort last name from low to high
How do I do this using react-table v7?