#Context values not being set correctly
1 messages · Page 1 of 1 (latest)
Based on the information extracts provided, I cannot find any direct issue with your code. However, I can provide some general advice on using context in Next.js.
In Next.js 13, context is fully supported within Client Components, but it cannot be created or consumed directly within Server Components. This is because Server Components have no React state (since they're not interactive), and context is primarily used for rerendering interactive components deep in the tree after some React state has been updated source (https://beta.nextjs.org/docs/rendering/server-and-client-components).
Make sure that you are using the context within Client Components and not Server Components. If you are still facing issues, I recommend checking your component hierarchy and ensuring that the components consuming the context are wrapped within the UserProvider.