Closed
Description
Link to the code that reproduces this issue
https://github.com/grzegorzpokorski/useoptimistic-issue
To Reproduce
- clone repo
pnpm i && pnpm lint && pnpm build
- you shouldn't see any errors after
pnpm lint
but build fails with following error:
Module '"react"' has no exported member 'experimental_useOptimistic'.
Current vs. Expected behavior
successfully build app
Verify canary release
- I verified that the issue exists in the latest Next.js canary release
Provide environment information
Operating System:
Platform: linux
Arch: x64
Version: #1 SMP Fri Jan 27 02:56:13 UTC 2023
Binaries:
Node: 18.18.2
npm: 9.8.1
Yarn: N/A
pnpm: 8.9.2
Relevant Packages:
next: 13.5.6
eslint-config-next: 13.5.6
react: 18.2.0
react-dom: 18.2.0
typescript: 5.2.2
Next.js Config:
output: N/A
Which area(s) are affected? (Select all that apply)
Not sure, ESLint (eslint-config-next)
Additional context
Recently React team removed experimantal_
prefix from some hooks facebook/react#27459.
I see that Next.js uses under hood experimental version of the React library where useOptimistic
does not require prefix but at build is used stable
version of React what causes error and fails build (?)