TanStack Query v4 → TanStack Query v5
mediumv5 simplifies the API — one query signature, no overloads. Minor breaking changes but the codemod handles 80% of the migration.
npm install @tanstack/react-query@5 && npm install -D @tanstack/eslint-plugin-query
Handles the signature changes automatically.
npx jscodeshift -t node_modules/@tanstack/react-query/build/codemods/v5/remove-overloads/remove-overloads.cjs src/
isLoading removed for disabled queries — use isPending. onSuccess/onError callbacks removed from useQuery — use useEffect or mutation callbacks.
Some generic type positions changed. Check components using QueryObserverResult types directly.
What this migration involves
Moving from TanStack Query v4 to TanStack Query v5 is rated medium and takes about 2-4h on a typical project. The guide breaks it into 5 steps, 2 of which ship with runnable commands and 1 with a verification check.
Related migrations
FAQ
How long does migrating from TanStack Query v4 to TanStack Query v5 take?
Around 2-4h for a typical project — 5 steps, difficulty rated medium, 2 of them with copy-paste commands.
Is moving from TanStack Query v4 to TanStack Query v5 reversible?
No reverse guide is tracked yet, so treat this as a one-way move and keep a full export of your TanStack Query v4 data before you start.
What does TanStack Query v5 cost compared to TanStack Query v4?
Pricing for both tools is contact-based or not tracked yet.