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

85
Visualizações
Prevent React component with list of items from scrolling to top on rerender

I've got a list of objects that I sort and loop out to create React components with some inputs, when the onChange is fired i dispatch and update my redux state. The list of objects is then updated via a selector and the list is sorted and rerendered, which causes the scroll to go to the top. If I don't sort the list then there's no issue, but I need to sort it according to some requirements.

How do i prevent the scroll from jumping to the top?

return (
<Root>
  <div>
    {sortQuestions(administrativeQuestions).map((administrativeQuestion) => (
      <QuestionItem key={administrativeQuestion.id} question={administrativeQuestion} />
    ))}
  </div>
</Root>
)
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