<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/infinite-scroll-in-react-complete-guide-for-dynamic-loading-wcq3hzvfj" -->

---
title: Infinite Scroll in React: Complete Guide for Dynamic Loading
description: Infinite Scroll is a web design technique that allows users to scroll through content continuously without pagination or clicking "Next" buttons. In this...
canonical: https://daily.dev/posts/infinite-scroll-in-react-complete-guide-for-dynamic-loading-wcq3hzvfj
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Infinite Scroll in React: Complete Guide for Dynamic Loading | daily.dev
og:description: Infinite Scroll is a web design technique that allows users to scroll through content continuously without pagination or clicking "Next" buttons. In this...
og:url: https://daily.dev/posts/infinite-scroll-in-react-complete-guide-for-dynamic-loading-wcq3hzvfj
og:image: https://api.daily.dev/og/posts/wcQ3hZVfj.png
og:image:alt: Infinite Scroll in React: Complete Guide for Dynamic Loading
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Infinite Scroll in React: Complete Guide for Dynamic Loading

**[Community Picks](https://daily.dev/sources/community)** · [@tropicolx](https://daily.dev/tropicolx) · 7 min read · 93 upvotes · 3 comments

## Summary

Infinite Scroll is a web design technique that allows users to scroll through content continuously without pagination or clicking "Next" buttons. In this guide, we'll implement infinite scrolling by building a card-based planet explorer. We'll explore the potential performance issues infinite scrolling can present and reveal optimization strategies to mitigate them.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://tropicolx.hashnode.dev/infinite-scrolling-in-react-a-practical-guide>

## Community discussion

Top comments from developers on daily.dev.

**@itsjavi** · 2 upvotes

> For the next version of the living dexes in supereffective.gg (open source Pokedex tracker) I need to use a lot of these techniques, specially for the Home boxes which can have up to 6000 Pokemon / DOM elements distributed in 200 boxes (30 each).
>
> What I am doing in this case is using the Intersection Observer on each box, and when it's not rendered I tell to not add the children, just a placeholder. This way it only contains 1 child instead of 30.
>
> I also have to give it a min-height when it's off-canvas, so the scroll doesn't jump.
>
> Other optimizations to consider: I also tell the browser...

---

Tags: [#react](https://daily.dev/tags/react), [#performance](https://daily.dev/tags/performance), [#git](https://daily.dev/tags/git), [#npm](https://daily.dev/tags/npm)

[View this post on daily.dev](https://daily.dev/posts/infinite-scroll-in-react-complete-guide-for-dynamic-loading-wcq3hzvfj)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Infinite Scroll in React: Complete Guide for Dynamic Loading","url":"https://daily.dev/posts/infinite-scroll-in-react-complete-guide-for-dynamic-loading-wcq3hzvfj","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/infinite-scroll-in-react-complete-guide-for-dynamic-loading-wcq3hzvfj"},"datePublished":"2023-08-28T13:29:51.087Z","dateModified":"2023-12-07T12:02:45.284Z","description":"Infinite Scroll is a web design technique that allows users to scroll through content continuously without pagination or clicking \"Next\" buttons. In this...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/fd6ccb18011672970075777d4404adc5?_a=AQAEufR","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/fd6ccb18011672970075777d4404adc5?_a=AQAEufR","isAccessibleForFree":true,"articleSection":"Community Picks","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Person","name":"Oluwabusayo Jacobs","url":"https://daily.dev/tropicolx","image":"https://media.daily.dev/image/upload/s--4yEbhBtq--/f_auto,q_auto/v1/avatars/avatar_hn9leQc5bp50ziYvEQvkG","description":"Dev in the Tropics | Software Engineer","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":580}},"commentCount":3,"discussionUrl":"https://daily.dev/posts/infinite-scroll-in-react-complete-guide-for-dynamic-loading-wcq3hzvfj","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":93},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":3}],"keywords":"react,performance,git,npm","timeRequired":"PT7M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Community Picks","item":"https://daily.dev/sources/community"},{"@type":"ListItem","position":3,"name":"Infinite Scroll in React: Complete Guide for Dynamic Loading"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/infinite-scroll-in-react-complete-guide-for-dynamic-loading-wcq3hzvfj","comment":[{"@type":"Comment","text":"For the next version of the living dexes in supereffective.gg (open source Pokedex tracker) I need to use a lot of these techniques, specially for the Home boxes which can have up to 6000 Pokemon / DOM elements distributed in 200 boxes (30 each).\nWhat I am doing in this case is using the Intersection Observer on each box, and when it’s not rendered I tell to not add the children, just a placeholder. This way it only contains 1 child instead of 30.\nI also have to give it a min-height when it’s off-canvas, so the scroll doesn’t jump.\nOther optimizations to consider: I also tell the browser to unload from the CPU what’s not on-screen using CSS’s “content-visibility: auto” + lazy loading of images (loading=“lazy”) + DOM Event Delegation from parent to children.\nThis is the only way to make an efficient pseudo-virtual scroll without sacrificing the power of CSS and CSS  flexbox / grids.\nRight now all the Virtual Scrolling libraries use absolute positioning for the elements, which is very intrusive IMHO.\nI hope that soon we will see better Web APIs to do Virtual Scrolling natively, but it seems we are still in the early years, sadly.","datePublished":"2023-08-30T21:20:02.254Z","dateModified":"2023-08-30T21:20:59.701Z","url":"https://daily.dev/posts/wcQ3hZVfj#c-FBazK1aSx","author":{"@type":"Person","name":"Javier","url":"https://daily.dev/itsjavi","image":"https://media.daily.dev/image/upload/s--Lhs9VFvX--/f_auto/v1711531445/avatars/avatar_L28cJws79VJWZec5RBvoy"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2}}]}
```

