react-virtualized, react-window, and react-virtual are libraries designed to handle rendering large datasets efficiently in React. They use a technique called windowing or virtualization, which only renders the items currently visible in the viewport. This approach drastically reduces DOM node count and improves scrolling performance. While react-virtualized is the legacy option with many built-in components, react-window is its lighter, modern successor focused on core windowing. react-virtual (now part of TanStack) offers a headless, hook-based approach that works across multiple frameworks.
When building data-heavy dashboards or feeds, rendering thousands of DOM nodes at once will slow down your application. react-virtualized, react-window, and react-virtual solve this by only rendering the items currently visible on the screen. While they share the same goal, their architectures and maintenance status differ significantly. Let's compare how they handle common engineering challenges.
react-virtualized relies on heavy class-based components.
<List> or <Grid>.// react-virtualized: Component-based
import { List } from 'react-virtualized';
<List
width={600}
height={400}
rowCount={1000}
rowHeight={50}
rowRenderer={({ index, style }) => (
<div style={style}>Row {index}</div>
)}
/>
react-window uses function components with a render prop pattern.
<FixedSizeList> or <VariableSizeList>.index and style.// react-window: Component with render prop
import { FixedSizeList } from 'react-window';
<FixedSizeList
width={600}
height={400}
itemCount={1000}
itemSize={50}
>
{({ index, style }) => (
<div style={style}>Row {index}</div>
)}
</FixedSizeList>
react-virtual provides a headless hook.
useVirtualizer to get virtual items.// react-virtual: Hook-based
import { useVirtualizer } from '@tanstack/react-virtual';
const virtualizer = useVirtualizer({
count: 1000,
getScrollElement: () => parentRef.current,
estimateSize: () => 50,
});
return (
<div ref={parentRef} style={{ height: '400px', overflow: 'auto' }}>
<div style={{ height: virtualizer.getTotalSize() }}>
{virtualizer.getVirtualItems().map((virtualItem) => (
<div key={virtualItem.key} style={{ transform: `translateY(${virtualItem.start}px)` }}>
Row {virtualItem.index}
</div>
))}
</div>
</div>
);
Resizing the virtual list when the window or container changes is a common requirement.
react-virtualized includes <AutoSizer> out of the box.
// react-virtualized: Built-in AutoSizer
import { List, AutoSizer } from 'react-virtualized';
<AutoSizer>
{({ height, width }) => (
<List
width={width}
height={height}
rowCount={1000}
rowHeight={50}
rowRenderer={({ index, style }) => (
<div style={style}>Row {index}</div>
)}
/>
)}
</AutoSizer>
react-window requires a separate package.
react-virtualized-auto-sizer.// react-window: External AutoSizer
import { FixedSizeList } from 'react-window';
import AutoSizer from 'react-virtualized-auto-sizer';
<AutoSizer>
{({ height, width }) => (
<FixedSizeList
width={width}
height={height}
itemCount={1000}
itemSize={50}
>
{({ index, style }) => (
<div style={style}>Row {index}</div>
)}
</FixedSizeList>
)}
</AutoSizer>
react-virtual handles resizing via observers.
// react-virtual: Observer-based
import { useVirtualizer } from '@tanstack/react-virtual';
const parentRef = useRef(null);
const virtualizer = useVirtualizer({
count: 1000,
getScrollElement: () => parentRef.current,
estimateSize: () => 50,
// ResizeObserver is handled internally
});
return (
<div ref={parentRef} style={{ overflow: 'auto' }}>
{/* Virtual items rendered here */}
</div>
);
Long-term support is critical when choosing infrastructure libraries.
react-virtualized is in maintenance mode.
react-window for new work.// react-virtualized: Legacy status
// ā ļø Not recommended for new projects
import { List } from 'react-virtualized';
react-window is actively maintained.
react-virtualized.// react-window: Active standard
// ā
Recommended for React-specific projects
import { FixedSizeList } from 'react-window';
react-virtual is part of the TanStack ecosystem.
// react-virtual: Modern headless
// ā
Recommended for custom layouts or non-React frameworks
import { useVirtualizer } from '@tanstack/react-virtual';
Despite their differences, all three libraries solve the same core problem using similar underlying math.
// All libraries: Render only visible items
// Instead of 1000 divs, only ~10 are in the DOM
transform or top/left.// All libraries: Use inline styles for position
style={{ transform: `translateY(${offset}px)` }}
// All libraries: Listen to scroll events
// Internal logic calculates startIndex and endIndex
| Feature | react-virtualized | react-window | react-virtual |
|---|---|---|---|
| API Style | š§± Class Components | āļø Function Components | šŖ Hooks (Headless) |
| Bundle Size | š Heavy | šŖ¶ Light | šŖ¶ Light |
| AutoSizer | ā Built-in | ā Separate Package | ā Internal Observer |
| Maintenance | ā ļø Legacy | ā Active | ā Active |
| Framework | āļø React Only | āļø React Only | š Framework Neutral |
react-virtualized is the legacy option š°ļø ā avoid it for new work unless you are stuck maintaining old code. It has too much weight for modern apps.
react-window is the standard choice š for React projects ā it is light, stable, and does exactly what most teams need without extra complexity.
react-virtual is the flexible choice š ļø for custom needs ā use it if you need headless logic, custom layouts, or support for frameworks beyond React.
Final Thought: For most React developers, react-window offers the best balance of performance and ease of use. If you need more control or framework neutrality, react-virtual is the modern alternative.
Choose react-virtual if you want a headless solution that gives you full control over rendering logic. It uses hooks instead of components, making it flexible for custom layouts or non-React frameworks like Solid or Vue. This option requires more setup but avoids locking you into specific component structures.
Choose react-virtualized only if you are maintaining an existing codebase that already depends on it. It includes many built-in components like Grid and Table, but it is heavier and no longer receives active feature development. For new projects, this package is considered legacy and should be avoided in favor of lighter alternatives.
Choose react-window if you need a reliable, React-specific solution for lists or grids with minimal overhead. It is the recommended successor to react-virtualized by the same author and offers better performance for standard use cases. You will need to pair it with react-virtualized-auto-sizer for dynamic container sizing.
Table of Contents generated with DocToc

Hooks for virtualizing scrollable elements in React
Enjoy this library? Try the entire TanStack! React Query, React Table, React Charts, React Form