0
Fork 0
mirror of https://github.com/TanStack/query.git synced 2026-11-18 19:33:22 +00:00
query/examples/react/nextjs
github-actions[bot] a8ecc8d42f
ci: Version Packages (#12128)
ci: changeset release

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
History 2026-10-19 18:54:46 +02:00
..
src fix(examples/react/nextjs): set a default 'staleTime' so the statically generated posts are not refetched right after hydration (#12077) 2026-10-18 22:27:27 +09:00
.gitignore v4 release (#3842) 2022-07-18 12:08:12 -06:00
.stackblitzrc chore(examples/react): add '.stackblitzrc' so StackBlitz runs the 'dev' script in the Next.js examples (#11976) 2026-10-12 03:35:35 +09:00
eslint.config.js chore(examples): use 'defineConfig' from 'eslint/config' and enable '@ts-check' in 'eslint.config.js' (#12008) 2026-10-14 10:01:19 +09:00
next.config.js chore(examples/react): remove the 'eslint' option that Next.js 16 no longer supports from 'next.config.js' (#11991) 2026-10-12 22:26:07 +09:00
package.json ci: Version Packages (#12128) 2026-10-19 18:54:46 +02:00
README.md v4 release (#3842) 2022-07-18 12:08:12 -06:00
tsconfig.json chore(examples/react): replace the legacy '.eslintrc' with a flat config and run 'test:eslint' (#11995) 2026-10-13 09:54:26 +09:00

Example

In this simple example, we integrate React-Query seamlessly with Next.js data fetching methods to fetch queries in the server and hydrate them in the browser.

In addition to fetching and mutating data, React-Query analyzes your queries and their results to construct a client-side cache of your data, which is kept up to date as further queries and mutations are run.

To run this example:

  • npm install
  • npm run dev