Skip to content

Commit b7174f4

Browse files
NicolappsConvex, Inc.
authored andcommitted
Move React framework docs (Next.js/TanStack Start) to their own category (#41328)
This moves the Next.js and TanStack Start docs out of the React category and creates new categories. There is now a TanStack category that contains the doc for both TanStack Query and TanStack Start. I also added a short section in the Next.js docs that leads to the React library docs and moved the Next.js server rendering docs above. GitOrigin-RevId: 9fdf6988ce6a22900bc04387531201658d51060f
1 parent d181f7b commit b7174f4

File tree

21 files changed

+99
-55
lines changed

21 files changed

+99
-55
lines changed

npm-packages/demos/nextjs-pages-router/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Convex functions were added to the `convex/` directory and a provider was added
1717
to `_app.tsx`.
1818

1919
To learn more about using Convex with Next.js, see the
20-
[Convex Next.js documentation](https://docs.convex.dev/client/react/nextjs)!
20+
[Convex Next.js documentation](https://docs.convex.dev/client/nextjs)!
2121

2222
## Running the App
2323

npm-packages/docs/_redirects

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@
7777
/using/indexes /database/indexes
7878
/using/integrations/airbyte /database/import-export/streaming
7979
/using/integrations/external-functions /functions/http-actions
80-
/using/integrations/nextjs /client/react/nextjs
80+
/using/integrations/nextjs /client/nextjs
8181
/using/integrations/react-native /client/react-native
8282
/using/integrations/s3-photo-upload /file-storage
83-
/using/nextjs /client/react/nextjs
83+
/using/nextjs /client/nextjs
8484
/using/optimistic-updates /client/react/optimistic-updates
8585
/using/pagination /database/pagination
8686
/using/project-setup /client/react/deployment-urls
@@ -99,9 +99,16 @@
9999
/using/writing-convex-functions /functions
100100
/vector_search /vector-search
101101
/vector-search /search/vector-search
102-
/client/react/nextjs/pages /client/react/nextjs-pages-router
103-
/client/react/nextjs/pages-quickstart /client/react/nextjs-pages-router/quickstart
102+
/client/react/nextjs/pages /client/nextjs/pages-router
103+
/client/react/nextjs/pages-quickstart /client/nextjs/pages-router/quickstart
104104
/client/react/quickstart-create-react-app /quickstart/react
105+
/client/react/nextjs/ /client/nextjs/app-router/
106+
/client/react/nextjs/server-rendering /client/nextjs/app-router/server-rendering
107+
/client/react/tanstack-start/ /client/tanstack/tanstack-start/
108+
/client/react/tanstack-start/tanstack-start-with-clerk /client/tanstack/tanstack-start/clerk
109+
/client/nextjs/ /client/nextjs/app-router/
110+
/client/tanstack /client/tanstack/tanstack-query
111+
/client/tanstack-query /client/tanstack/tanstack-query
105112
/deployments /dashboard/deployments
106113
/database/import-export/streaming /production/integrations/streaming-import-export
107114
/auth/custom-auth /auth/advanced/custom-auth

npm-packages/docs/docs/auth/auth0.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ multi-factor authentication, and single sign on and basic user management.
2020
[Convex Authentication with Auth0](https://github.com/get-convex/convex-demos/tree/main/users-and-auth)
2121

2222
If you're using Next.js see the
23-
[Next.js setup guide](https://docs.convex.dev/client/react/nextjs).
23+
[Next.js setup guide](https://docs.convex.dev/client/nextjs).
2424

2525
## Get started
2626

npm-packages/docs/docs/auth/clerk.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ follow the [Convex Next.js Quickstart](/quickstart/nextjs.mdx) first. Then:
431431
[Tanstack Start with Convex and Clerk](https://github.com/get-convex/templates/tree/main/template-tanstack-start)
432432

433433
See the
434-
[Tanstack Start with Clerk guide](/client/react/tanstack-start/clerk.mdx) for
434+
[Tanstack Start with Clerk guide](/client/tanstack/tanstack-start/clerk.mdx) for
435435
more information.
436436

437437
## Next steps

npm-packages/docs/docs/auth/debug.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ To handle this, you can either:
3030
on the client
3131

3232
If you are using `fetchQuery` for
33-
[Next.js Server Rendering](/client/react/nextjs/nextjs-server-rendering.mdx),
34-
make sure you are explicitly passing in a JWT token as documented
35-
[here](/client/react/nextjs/nextjs-server-rendering.mdx#server-side-authentication).
33+
[Next.js Server Rendering](/client/nextjs/app-router/server-rendering.mdx), make
34+
sure you are explicitly passing in a JWT token as documented
35+
[here](/client/nextjs/app-router/server-rendering.mdx#server-side-authentication).
3636

3737
If this hasn't helped, follow the steps below to resolve your issue.
3838

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"label": "App Router",
3+
"position": 10
4+
}

npm-packages/docs/docs/client/react/nextjs/nextjs.mdx renamed to npm-packages/docs/docs/client/nextjs/app-router/index.mdx

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,42 @@ with Convex, Next.js provides:
1717
and more!
1818

1919
This page covers the App Router variant of Next.js. Alternatively see the
20-
[Pages Router](/client/react/nextjs-pages-router/nextjs-pages-router.mdx)
21-
version of this page.
20+
[Pages Router](/client/nextjs/pages-router/index.mdx) version of this page.
2221

2322
## Getting started
2423

2524
Follow the [Next.js Quickstart](/quickstart/nextjs.mdx) to add Convex to a new
2625
or existing Next.js project.
2726

27+
## Calling Convex functions from client code
28+
29+
To fetch and edit the data in your database from client code, use hooks of the
30+
[Convex React library](/client/react).
31+
32+
<CardLink
33+
className="convex-hero-card"
34+
item={{
35+
href: "/client/react",
36+
label: "Convex React library documentation",
37+
}}
38+
/>
39+
40+
## Server rendering (SSR)
41+
42+
Next.js automatically renders both Client and Server Components on the server
43+
during the initial page load.
44+
45+
To keep your UI
46+
[automatically reactive](/functions/query-functions.mdx#caching--reactivity--consistency)
47+
to changes in your Convex database it needs to use Client Components. The
48+
`ConvexReactClient` will maintain a connection to your deployment and will get
49+
updates as data changes and that must happen on the client.
50+
51+
See the dedicated
52+
[Server Rendering](/client/nextjs/app-router/server-rendering.mdx) page for more
53+
details about preloading data for Client Components, fetching data and
54+
authentication in Server Components, and implementing Route Handlers.
55+
2856
## Adding authentication
2957

3058
### Client-side only
@@ -92,19 +120,3 @@ mutations, and actions in server components and API routes.
92120
Obtain the appropriate OpenID Identity JWT in both locations and you should be
93121
able to use any auth provider. See
94122
[Custom Auth](https://docs.convex.dev/auth/advanced/custom-auth) for more.
95-
96-
## Server rendering (SSR)
97-
98-
Next.js automatically renders both Client and Server Components on the server
99-
during the initial page load.
100-
101-
To keep your UI
102-
[automatically reactive](/functions/query-functions.mdx#caching--reactivity--consistency)
103-
to changes in your Convex database it needs to use Client Components. The
104-
`ConvexReactClient` will maintain a connection to your deployment and will get
105-
updates as data changes and that must happen on the client.
106-
107-
See the dedicated
108-
[Server Rendering](/client/react/nextjs/nextjs-server-rendering.mdx) page for
109-
more details about preloading data for Client Components, fetching data and
110-
authentication in Server Components, and implementing Route Handlers.

npm-packages/docs/docs/client/react/nextjs/nextjs-server-rendering.mdx renamed to npm-packages/docs/docs/client/nextjs/app-router/server-rendering.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
title: "Next.js Server Rendering"
3-
slug: "server-rendering"
43
sidebar_label: "Server Rendering"
54
sidebar_position: 10
65
description:
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"label": "Pages Router",
3+
"position": 20
4+
}
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
title: "Next.js Pages Router"
3-
slug: "nextjs-pages-router"
43
sidebar_position: 250
54
sidebar_label: "Next.js Pages Router"
65
description:
@@ -12,12 +11,12 @@ import simpleAuthedAppTSX from "!!raw-loader!@site/../demos/nextjs-pages-router/
1211
import apiTS from "!!raw-loader!@site/../demos/nextjs-pages-router/pages/api/clicks.ts";
1312

1413
This pages covers the Pages Router variant of Next.js. Alternatively see the
15-
[App Router](/client/react/nextjs/nextjs.mdx) version of this page.
14+
[App Router](/client/nextjs/app-router/index.mdx) version of this page.
1615

1716
## Getting started
1817

1918
Follow the
20-
[Next.js Pages Router Quickstart](/client/react/nextjs-pages-router/quickstart-nextjs-pages-router.mdx)
19+
[Next.js Pages Router Quickstart](/client/nextjs/pages-router/quickstart-nextjs-pages-router.mdx)
2120
to add Convex to a new or existing Next.js project.
2221

2322
## Adding client-side authentication
@@ -96,5 +95,5 @@ third argument of `fetchQuery`.
9695

9796
To preload data on server side before rendering a reactive query on the client
9897
side use [`preloadQuery`](/api/modules/nextjs#preloadquery). Check out the
99-
[App Router version of these docs](/client/react/nextjs/nextjs-server-rendering.mdx)
98+
[App Router version of these docs](/client/nextjs/app-router/server-rendering.mdx)
10099
for more details.

0 commit comments

Comments
 (0)