From 8ec940bd6a3e2e739746096ed9703607a5bdc047 Mon Sep 17 00:00:00 2001 From: Misha Kaletsky <15040698+mmkal@users.noreply.github.com> Date: Thu, 21 Jul 2022 07:59:46 -0400 Subject: [PATCH] docs: highlight archiving of next-auth/react-query (#4964) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: highlight archiving of next-auth/react-query project is read-only and author said users should just copy-paste the implementation: https://github.com/nextauthjs/react-query/issues/7#issuecomment-923099050 * Update docs/docs/getting-started/client.md Co-authored-by: Balázs Orbán * Update docs/docs/getting-started/client.md Co-authored-by: Balázs Orbán Co-authored-by: Balázs Orbán --- docs/docs/getting-started/client.md | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/docs/docs/getting-started/client.md b/docs/docs/getting-started/client.md index 23bbc7c721..6ede0b9c2f 100644 --- a/docs/docs/getting-started/client.md +++ b/docs/docs/getting-started/client.md @@ -148,13 +148,9 @@ Because of how `_app` is written, it won't unnecessarily contact the `/api/auth/ More information can be found in the following [GitHub Issue](https://github.com/nextauthjs/next-auth/issues/1210). -### NextAuth.js + React-Query +### NextAuth.js + React Query -There is also an alternative client-side API library based upon [`react-query`](https://www.npmjs.com/package/react-query) available under [`nextauthjs/react-query`](https://github.com/nextauthjs/react-query). - -If you use `react-query` in your project already, you can leverage it with NextAuth.js to handle the client-side session management for you as well. This replaces NextAuth.js's native `useSession` and `SessionProvider` from `next-auth/react`. - -See repository [`README`](https://github.com/nextauthjs/react-query) for more details. +You can create your own session management solution using data fetching libraries like [React Query](https://tanstack.com/query/v4/docs/adapters/react-query) or [SWR](https://swr.vercel.app). You can use the [original implementation of `@next-auth/react-query`](https://github.com/nextauthjs/react-query) and look at the [`next-auth/react` source code](https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/react/index.tsx) as a starting point. --- @@ -531,4 +527,4 @@ export default function App({ ) } -``` \ No newline at end of file +```