Question · JavaScript and React course · Module 9: Modern React Hooks

react-window - how it works

How does the react-window library implement list virtualization?

Answer options

  • It compresses DOM elements into a single element with Canvas
  • It moves list rendering to a Web Worker
  • It renders only elements visible in the viewport, dynamically adding and removing DOM elements on scroll
  • It caches all elements in memory and displays them using CSS display:none

You can check the correct answer by solving this task in the CodeWorlds game.