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

57
Visualizações
IntersectionObserver is not triggered when div ref is conditionally rendered

I'm trying to build infinite scroll pagination in React, and using JavaScript's IntersectionObserver to attach a load more div. Basically when the user scrolls down to the table then - Loading... text will come up and an API is being called to fetch the table contents from backend. The issue is If I show the Loading... text without any conditional rendering , then the IntersectionObserver is being properly triggered but when I add a condition to render the Loading... text then the IntersectionObserver is not being triggered at all.

From the backend API , I will be getting numberOfPages variable , which will define how many pages/ records present in db , in return Loading... text shouldn't come up after it reaches the last page. This is what I've tried so far. Also tried one of the blog i found out Blog Link.

Codesandbox code : Code link

Live : Live demo here

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