// the find
tannerlinsley/react-query-blog-refactor-example
A commit-by-commit story of building your own global async server-state management, then migrating it to React Query
A Next.js example repo that walks commit-by-commit through building a hand-rolled global server-state layer, then ripping it out for React Query. It's aimed at developers who are still doing manual useState/useEffect data fetching and need a concrete before/after to see why a query library earns its keep.
The commit history is the actual teaching device rather than a slide deck — you can literally diff each stage to see exactly how much code global caching, deduping, and cache invalidation cost you by hand. It covers real edge cases people hit (stale total-count sidebar, stale title on lookup) rather than a strawman example. Ends on genuinely advanced React Query patterns (optimistic updates with rollback, infinite queries, hover-prefetch) instead of stopping at basic useQuery.
Last push was January 2023, so it predates React Query v4/v5's breaking API changes (queryClient, object-based signatures) — copy-pasting hooks from here into a current project won't work without translation. It's a teaching artifact, not a library: no tests, no CI, in-memory API that resets on every save, so there's nothing to actually adopt, only to read. Single-author, no issues/PR activity, so there's no evidence anyone's kept it in sync with React Query's evolution since Tanner's own docs superseded it.