Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

304
Views
react-table custom sortType not able to sort columns

I'm trying to define a custom sorting function in a column def using react-table . However, when using this custom function the table columns are not sortable. I think there is something incorrect with my syntax.

This works (I am able to sort the columns)

sortType: column.accessor === "myColumnId" ? "basic" : "alphanumeric"

This does not work (I am not able to sort any columns):

sortType: getWoSortType,

where getWoSortType looks like this:


// sort types
export const getWoSortType = (rowA, rowB, id) => {
  switch (id) {
    case "isolationPlans":
      return "basic";
    default:
      return "alphanumeric";
  }
};

I have tried debugging getWoSortType and everything looks correct, i. e. the values are defined and the correct cases are being reached. Why does it not work using this other syntax?

about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!