Closed MiguelG97 closed 4 months ago
Hi @MiguelG97 👋 If you haven't already, you may want to check out our @apollo/experimental-nextjs-app-support
library at https://github.com/apollographql/apollo-client-nextjs
To your question, Apollo Client does use rehackt
- if you're curious as to why, there's more information in its README.
But back to the error you're seeing: is an RSC rendering your RootLayout
? If that's the case, I would expect you to see that error since React context is not supported in Server Components.
thanks for the hints, apparently if I create another react component and label it as "use client", it lets me wrap the layout content without issues
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo Client usage and allow us to serve you better.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. For general questions, we recommend using StackOverflow or our discord server.
Issue Description
I encountered this issue while integrating apollo client graphql in a nextjs app.
Apparently apollo is using rehackt npm package and somehow it's not exporting the useContext functionality:
Link to Reproduction
code below
Reproduction Steps
in a nextjs project, wrap the content with the apolloProvider in a LAYOUT page!:
@apollo/client
version^3.10.4