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

100
Vistas
React diff why not mapRemainingChildren at once directly?

I spent time reading stuff about React diff algorithm recently, and I get to know there are two steps of array-like children diff:

  1. loop from both current first fiber and react first element, compare type until conflicts
  2. mapRemainingChildren and keep looping the remaing react element , try find usable old fiber.

So, here is my question, why not mapping all old fiber at once ? Like why not only use step2 ?

I believe both steps above should share a same time complexity like O(N), to keep React diff average O(N). And step2 could cover cases in step1. So, I think step1 is quite redundant.

Is there any more consideration about this design?

about 4 years ago · Juan Pablo Isaza
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