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

146
Visualizações
React optimize render for large object of array

I have a large list of array that has about 10,000 lists and I want to minimize the rendering of object to the current list.

There are several solutions that I have found like react-window or react-virtualized to render only the visible components but it does not seem to suit for my current needs.

These 10,000 items will propagate the certain events to the upper components for this I have tried context but it seems to rerender every children even if one of them triggers the function this has lead to memoization hell. Every child and every components has been used unnecessary memoization.

I have simplified the array of object to be in the following format with key and arrays for quick processing

  var data = {
    key: [{},{},{}],
    key2: [{},{}],
    ...
    ...
    ..n
  }

The problem right now is react takes about a second to diff the components and this makes the whole app slow. If I go to profiler I see that react takes about 0.1ms for a components in the array this comes out to be 0.1 * 10000 ms which is way too large diffing time. I would like to memoize the components so when even if I add or update the objects inside the object it diffs only that components and does not rediff every component.

eg. Data manipulation equivalent in js
// Suppose only first object's title is changed and updated to state
data[key][0].title = 'asd' 

This quickly adds up when the individual component will have it's own state and further child component and so on. I would like to have a efficient solution if possible for this.

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