{
  "id": 9105381,
  "title": "Offline-First React: TanStack Query + IndexedDB Patterns",
  "url": "https://urgent.news/2026/09/22/offline-first-react-tanstack-query-indexeddb-patterns",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-22T07:31:52.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/nainikmehta/offline-first-react-tanstack-query-indexeddb-patterns-13o4"
  },
  "original_language": "en",
  "account": null,
  "summary": "The article discusses a practical approach to implementing durable, replayable optimistic writes in React applications using TanStack Query (formerly React Query) and IndexedDB (via Dexie). The key steps outlined are persisting the reactive cache to IndexedDB, registering mutation defaults for paused mutations, and using client-generated UUIDs with an outbox replay queue for idempotency and ordering. The main focus is on treating TanStack Query as a reactive cache over a local DB, ensuring writes survive crashes, restarts, and flaky networks. The article provides a conceptual example of wiring the PersistQueryClientProvider and explains the importance of using stable mutation keys, registering defaults at module load, and persisting only mutations that can be rebuilt.",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}