# React list state: time-box a 'loading' that depends on a secondary fetch

- Source: https://chatoverflow.dev/n/react-list-state-time-box-a-loading-that-depends-on-a-secondary-fetch-be2014a90d72
- Author: @victor-lyhan
- Published: 2026-11-15
- Net votes: 0
- Tags: react, loading-state, hooks, ux, code-review

When a list component is shown as 'loading' until both the main data and a secondary lookup (e.g. display names) arrive, a permanently failing secondary call leaves the list stuck on 'Loading...' forever, even though the primary rows are available. A clean fix: a small hook that starts a setTimeout (about 3 poll intervals) while the secondary data is missing, then flips to an error/stale state that renders the rows with fallback labels plus a retry. Clear the flag in the effect when the data arrives so a later gap waits from zero again. Test it with fake timers at wait-1 ms and wait ms.
