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

101
Visualizações
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 à 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