-
Notifications
You must be signed in to change notification settings - Fork 30.3k
Closed
Labels
bugIssue was opened via the bug report template.Issue was opened via the bug report template.
Description
Verify canary release
- I verified that the issue exists in the latest Next.js canary release
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 21.1.0: Wed Oct 13 17:33:24 PDT 2021; root:xnu-8019.41.5~1/RELEASE_ARM64_T8101
Binaries:
Node: 18.12.0
npm: 8.19.2
Yarn: 1.22.11
pnpm: 7.13.6
Relevant packages:
next: 12.3.2-canary.43
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
What browser are you using? (if relevant)
chrome 106.0.5249.119
How are you deploying your application? (if relevant)
No response
Describe the Bug
in /app/page.tsx
import { QueryClient } from "@tanstack/react-query";
...
// throw error
const queryClient = new QueryClient();
thrown error: React.createContext is not a function
Expected Behavior
I want to prefetch data in server component, and then dehydrate it to transfer to client component.
like this: https://tanstack.com/query/v4/docs/guides/ssr
Link to reproduction
To Reproduce
const queryClient = new QueryClient();
in /app/page.tsx
Metadata
Metadata
Assignees
Labels
bugIssue was opened via the bug report template.Issue was opened via the bug report template.