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

122
Visualizações
Ordering mapped data after connecting to a websocket with React

I have an array of ids relating to objects saved in the database.

<TableBody>
    {
        ids.map((id, i) => (
            <CustomSocketRow
            key={i}
            id={id}/>
        ))
    }
</TableBody>

I am currently mapping each id to a websocket, where data is fetched on connecting, and data is updated in real-time if changed elsewhere on the site. The problem I have is that, because I am only mapping the Ids I am unable to sort the data within the table, which is essential.

I need to sort by a date field in one of the columns which can be thought of as the internal state of one of the rows. I need to somehow wait until all of the rows are populated with data, and then sort the rows.

I think that this is an issue with the architecture of the components, more than a syntactical problem, but I don't know the best approach.

about 4 years ago · Santiago Gelvez
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