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

121
Vistas
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 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