SuperAPI AI Directory

tanstack-react-query-best-practices

Frontend & websites

View repository

Updated 10-15 20:10

About this skill

TanStack React Query Best Practices

Treat server data as cache-backed asynchronous state with an explicit owner, identity, and view boundary; the outcome is reliable loading and error handling plus focused updates after writes.

Library Sources

  • GitHub repository ID: TanStack/query
  • Context7 library ID: /tanstack/query
  • DeepWiki repository ID: TanStack/query

Use Context7 for current documentation and DeepWiki for implementation details.

References

Read the references that apply to the current task before writing or reviewing TanStack Query code.

  1. Let TanStack Query own server-request lifecycle and cache identity.
  2. Resolve query status before presentation consumes data.
  3. Keep mutation data, callbacks, and cache updates scoped to each operation.