Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

305
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda