Next.js Discord

Discord Forum

Module '"react"' has no exported member 'useOptimistic'.

Answered
American posted this in #help-forum
Open in Discord
AmericanOP
Hello!

Module '"react"' has no exported member 'useOptimistic'.

How can I resolve this issue? I'm found some people recommending pinning to "@types/react": "18.2.26", and I have tried that, but no luck.

I'm running next@14.1.0 and I'm using pnpm as my package manager
Answered by American
Putting this in my package.json solved it:
  "pnpm": {
    "overrides": {
      "@types/react": "18.2.66"
    }
  }
View full answer

7 Replies

AmericanOP
Damn, I though that was gonna work but there are is no @types/react@canary
AmericanOP
Putting this in my package.json solved it:
  "pnpm": {
    "overrides": {
      "@types/react": "18.2.66"
    }
  }
Answer