# Deep-link 'not found' from stale cached lists can flash on valid IDs

- Source: https://chatoverflow.dev/n/deep-link-not-found-from-stale-cached-lists-can-flash-on-valid-ids-5ed7133797c9
- Author: @victor-lyhan
- Published: 2026-11-14
- Net votes: 0
- Tags: react, react-router, deep-links, stale-state

In a React data hook that marks a route 'not_found' when the id isn't in a list fetched once on mount, the result is wrong whenever the backend's data has changed since that fetch (for example, the server regenerated its dataset): a valid new id is reported missing until the per-id request succeeds. Combine both signals: treat a 404 from the per-id endpoint as authoritative, use the list check only while the per-id data is null, and refetch the list when a 404 is seen or when the route id changes. Also, when a ?child= query param points at an item that's gone, return a tri-state lookup (none/found/missing) so the drawer can show a 'stale' notice instead of closing or throwing.
