-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
React 19 support
Current Behavior
When using React 19, e.g. "react": "^19.0.0-beta-26f2496093-20240514", in package.json running "npm install" gives this error:
"npm ERR! Conflicting peer dependency: react@18.3.1
npm ERR! node_modules/react
npm ERR! peer react@"^16.8.0 || ^17 || ^18" from react-hook-form@7.51.4"
This is when using the latest: "@radix-ui/react-form": "^0.0.4-rc.6"
To overcome this error: "npm install --legacy-peer-deps"
Expected behavior
run "npm install" without error
Reproducible example
Package.json
{ "private": true, "scripts": { "clean": "rimraf .next", "predev": "npm run clean", "prebuild": "npm run clean", "dev": "next dev", "build": "next build", "start": "next start", "lint": "next lint" }, "dependencies": { "@babel/runtime": "^7.24.5", "@hookform/resolvers": "^1.0.0-rc.2", "@radix-ui/react-checkbox": "^1.0.4-rc.11", "@radix-ui/react-form": "^0.0.4-rc.6", "@radix-ui/react-icons": "^1.3.0", "@stylexjs/babel-plugin": "^0.6.1", "@stylexjs/open-props": "^0.6.1", "@stylexjs/stylex": "^0.6.1", "@supabase/ssr": "latest", "@supabase/supabase-js": "latest", "@tanstack/react-query": "^5.36.0", "@tanstack/react-query-devtools": "^5.36.0", "@vercel/speed-insights": "^1.0.10", "babel-plugin-react-compiler": "^0.0.0-experimental-592953e-20240517", "eslint-plugin-react-compiler": "^0.0.0-experimental-c8b3f72-20240517", "next": "^14.3.0-canary.70", "react": "^19.0.0-beta-26f2496093-20240514", "react-dom": "^19.0.0-beta-26f2496093-20240514", "react-hot-toast": "^2.4.1", "sharp": "^0.33.4", "typescript": "5.4.5" }, "devDependencies": { "@babel/plugin-transform-private-methods": "^7.24.1", "@playwright/test": "^1.43.1", "@stylexjs/dev-runtime": "^0.6.1", "@stylexjs/eslint-plugin": "^0.6.1", "@stylexjs/nextjs-plugin": "^0.6.1", "@tanstack/eslint-plugin-query": "^5.35.6", "@types/node": "20.12.12", "@types/react": "18.3.2", "@types/react-dom": "18.3.0", "encoding": "^0.1.13", "eslint": "^8.56.0", "eslint-config-next": "latest", "openapi-typescript": "^5.4.0", "prettier-plugin-stylex-key-sort": "^1.0.1", "rimraf": "^5.0.7" } }
Suggested solution
update dependencies to allow installing with React 19
Additional context
Low priority since there is a work around, but wanted to get this on the radar
Your environment
| Software | Name(s) | Version |
|---|---|---|
| Radix Package(s) | @radix-ui/react-form | ^0.0.4-rc.6 |
| React | n/a | ^19.0.0-beta-26f2496093-20240514 |
| Browser | n/a | n/a |
| Assistive tech | n/a | n/a |
| Node | n/a | v20.13.1 |
| npm/yarn | npm | v10.5.2 |
| Operating System | macos | 14.5 (23F79) |