React
Avancé
Implementing infinite scroll with IntersectionObserver

Type d'évaluation

Mise en situation réelle

Analyse

Intelligence Artificielle

Compétences ciblées

react
infinite-scroll
intersectionobserver
useeffect
performance

Scénario Technique

Context A social feed loads 20 posts at a time and must automatically load the next page when the user scrolls near the bottom. The Problem The team is using a scroll event listener on the window to detect the bottom of the page, which fires hundreds of times per scroll and causes jank. Constraints Replace the scroll listener with an IntersectionObserver targeting a sentinel element at the list bottom. Manage the observer lifecycle inside a useEffect. Append new results to the existing list without replacing it. Expected Deliverable A React infinite scroll implementation using IntersectionObserver, with correct observer cleanup and accumulative page data management.

Prêt à évaluer ce talent ?

Accédez à l'interface de test complète pour soumettre votre architecture ou votre code.

Commencer le Défis
    React - Implementing infinite scroll with IntersectionObserver | Défi Technique & Recrutement — CodeDuel