Rules Hub
Coding Rules Library
← Back to all rules
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
frontend ruleP2stack specificStack: react
reactperformancevirtualizationlists
Prefer a virtualized list over combining infinite scroll with pagination
When the goal is rendering a large list performantly, use list virtualization rather than wiring infinite-scroll fetching alongside pagination.
PR: hegnar-forum-web · org-mining-hist-2026-06Created: Jun 20, 2026
Bad example
Old codetsx
| 1 | // 200 items: paginate in 25s AND attach an infinite-scroll ref to fetch more |
| 2 | <Row ref={i === len - 1 && len <= 175 ? lastElementRef : null} /> |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | // Render eagerly into a virtualized list; only visible rows mount |
| 2 | <VirtualizedList items={items} renderItem={renderRow} /> |
Explanation (EN)
Objašnjenje (HR)