Performancemedium
How do you implement virtualization in a large list of components in React?
Discuss the key concepts and libraries used in implementing virtualization to render only visible components in a large list for improved performance.
Asked at Facebook, Google, Netflix
Answer
Use libraries like react-window or react-virtualized to:
- Render only components in the viewport to reduce DOM nodes.
- Manage scroll events efficiently for performance.
- Consider trade-offs like load times vs. scrolling experience.
Source: Interview Guide