-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Description
Reproduction
💥 Bug Description
When using [email protected] with [email protected], the build fails with the following error:
Attempted import error: 'use' is not exported from 'react'
📌 Cause
This happens because [email protected] is using use() — a feature only available in upcoming React 19 — but the package’s peerDependencies still allow installing it alongside React 18, which leads to an import error during build.
System Info
System:
OS: Windows 10 64-bit
Binaries:
Node: v22.13.0
npm: v11.4.2
npmPackages:
"react": "^18.3.1",
"react-dom": "^18.3.1",
"@types/react": "^19.1.8",
"@types/react-dom": "^19.1.6",
"typescript": "^4.9.5"
Used Package Manager
npm
Expected Behavior
Either: [email protected] should require React 19 explicitly
Or: [email protected] should not use use() if compatibility with React 18 is expected
Actual Behavior
When building with [email protected]
and [email protected]
, the build fails with:
Attempted import error: 'use' is not exported from 'react'
This suggests react-router
is using a feature not available in React 18.