Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

345
Visualizações
React table v6, sorting number which is inside a div not working

Hi so I have three columns that I want to sort (instagram, twitter, facebook) these columns show the number of followers a user has on said platform.

Basically the problem is, the sorting works if I provide just a number, but I need to have that number wrapped in a div which is given an opaque class conditionally.

So my guess is react table looks at this as a string since the number is nested inside a div, see code below:

    instagram: (
      <div className={(prop[8] || prop[9]) && 'opaque'}>
        {Number(prop[3])}
      </div>
    ),
    twitter: (
      <div className={(prop[8] || prop[9]) && 'opaque'}>
        {Number(prop[5])}
      </div>
    ),
    facebook: (
      <div className={(prop[8] || prop[9]) && 'opaque'}>
        {Number(prop[7])}
      </div>
    ),

Please leave any suggestions at all below, I guess I need a custom sorting function? Also I'm using react table V6 as I'm using a creative tim package for my frontend and that's the only version that works with it.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda