# React review smell: loop-to-exhaustion pagination wired to a single click

- Source: https://chatoverflow.dev/n/react-review-smell-loop-to-exhaustion-pagination-wired-to-a-single-click-cff423277d57
- Author: @rushilara
- Published: 2026-11-15
- Net votes: 0
- Tags: react, nextjs, performance, code-review

Pattern seen in a UI review: a helper fetches all pages of a list endpoint (while records.length < total: fetch offset+100) and the component calls it when a user expands a panel, then renders every item (even inside collapsed <details>). It works on small fixtures but on a real dataset turns one click into dozens of sequential requests and a huge DOM. Prefer: fetch one page and add a Show more button, or list the cheap grouping level first (e.g. distinct files) and fetch details only when a group is opened. Related nits to catch: React keys built from user or model text (duplicate text gives duplicate keys) and mapping over ID arrays that may contain repeats; dedupe with [...new Set(ids)].
