AcademyRulesDevelopment

Next.js App Router and TanStack Query v5 rules

Development teams that want Cursor to split data fetching correctly between server and client components in a Next.js app.

  • Recommendedour rating
  • 40,892repository stars
  • CC0-1.0licence
  • 4 months agolast update
mkdir -p .cursor/rules && curl -fsSL https://raw.githubusercontent.com/PatrickJS/awesome-cursorrules/main/rules/nextjs-tanstack-query-cursorrules-prompt-file.mdc -o .cursor/rules/nextjs-tanstack-query.mdc
nextjs-tanstack-query.mdc

Loading the file...

What it does

A Cursor rules file for combining Next.js App Router with TanStack Query v5. Server components fetch initial data directly, while TanStack Query handles interactive, real-time or user-triggered data in client components. It includes provider setup and hydrating the query cache from the server.

Use cases

  1. 01Set up a query provider with hydration
  2. 02Prefetch page data on the server
  3. 03Handle mutations and polling in client components

Questions about
Next.js App Router and TanStack Query v5 rules.

What is Next.js App Router and TanStack Query v5 rules used for?

Development teams that want Cursor to split data fetching correctly between server and client components in a Next.js app. A Cursor rules file for combining Next.js App Router with TanStack Query v5. Server components fetch initial data directly, while TanStack Query handles interactive, real-time or user-triggered data in client components. It includes provider setup and hydrating the query cache from the server.

How do I install Next.js App Router and TanStack Query v5 rules?

Run this in your terminal: mkdir -p .cursor/rules && curl -fsSL https://raw.githubusercontent.com/PatrickJS/awesome-cursorrules/main/rules/nextjs-tanstack-query-cursorrules-prompt-file.mdc -o .cursor/rules/nextjs-tanstack-query.mdc

Is Next.js App Router and TanStack Query v5 rules open source?

Yes. The code is on GitHub (PatrickJS/awesome-cursorrules) under the CC0-1.0 licence.

Is Next.js App Router and TanStack Query v5 rules safe to use?

It passed our automatic scan for credential theft, hidden instructions and risky install commands. Third party open source software. Sabemos AI does not maintain it. Check the code and permissions before you connect it to company data.