Skip to content

Error with NextAuth + React-query This Suspense boundary received an update before it finished hydrating #7503

Discussion options

You must be logged in to vote

Copying my recent answer from Twitter.

https://x.com/balazsorban44/status/1811722891915886894

There's no reason to use SessionProvider with React Query. In fact, I toyed with an official integration before https://github.com/nextauthjs/react-query, but dropped it as I had no bandwidth to maintain. All you need to do is hook up fetch /api/auth/session though.

We could add a guide! Anyone wants to PR?

Technically, Auth.js is nothing else than some endpoints that React Query can integrate with itself. SessionProvider is basically just a poorer version of React Query implementation.

See the source here https://github.com/nextauthjs/next-auth/blob/main/packages/next-auth/src/react.tsx

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@enyelsequeira
Comment options

Comment options

You must be logged in to vote
1 reply
@enyelsequeira
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by balazsorban44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.
4 participants
Converted from issue

This discussion was converted from issue #7500 on May 10, 2023 09:39.