Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React 18 peer dependency errors from radix dependencies #2089

Closed
2 tasks
irl-dan opened this issue Jun 13, 2022 · 6 comments · Fixed by #2558
Closed
2 tasks

React 18 peer dependency errors from radix dependencies #2089

irl-dan opened this issue Jun 13, 2022 · 6 comments · Fixed by #2558
Assignees
Labels
bug Something isn't working Primitive An issue or a feature-request for one or more UI Primitive React An issue or a feature-request for React platform

Comments

@irl-dan
Copy link

irl-dan commented Jun 13, 2022

On which framework/platform would you like to see this feature implemented?

React

Which UI component is this feature-request for?

Other

Please describe your feature-request in detail.

We're trying to use @aws-amplify/ui-react with the React 18 and we're seeing this is not supported:

On npm install, with "react": "^18.0.0", and "@aws-amplify/ui-react": "^2.19.1", in our package.json dependencies, we get the following error:

npm ERR! Found: react@18.0.0
npm ERR! node_modules/react
npm ERR!   react@"^18.0.0" from the root project
npm ERR!   peer react@">= 16.8.0" from @aws-amplify/ui-react@2.19.1
npm ERR!   node_modules/@aws-amplify/ui-react
npm ERR!     @aws-amplify/ui-react@"^2.19.1" from the root project

React 18 is the latest supported release of React and we'd love to see support for it from Amplify!

Please describe a solution you'd like.

This is a matter of upgrading the peerDependencies here:

"react": ">= 16.8.0",

We love contributors! Is this something you'd be interested in working on?

  • 👋 I may be able to implement this feature request.
  • ⚠️ This feature might incur a breaking change.
@irl-dan irl-dan added the feature-request Request a new feature label Jun 13, 2022
@reesscot reesscot added bug Something isn't working React An issue or a feature-request for React platform and removed feature-request Request a new feature labels Jun 13, 2022
@reesscot
Copy link
Contributor

Hi @irl-dan,
Despite the error message you are seeing, our library does indeed support React 18. The reason that you are seeing this error is because we depend on upstream packages which haven't yet been updated to include 18 in their react peer dependency declaration. We haven't seen any issues with using React 18 with Amplify UI, but if you find anything please do open a new GitHub issue. Once Radix releases the React 18 package.json changes, we will update and the error message will go away.

In the meantime, you can use the --legacy-peer-deps option to silence the error message:

npm install @aws-amplify/ui-react --legacy-peer-deps

@reesscot reesscot self-assigned this Jun 13, 2022
@irl-dan
Copy link
Author

irl-dan commented Jun 13, 2022

Aha, thank you for the insight! Feel free to close this ticket if it just creates spam. I'll keep an eye on the linked issue in radix-ui.

@reesscot reesscot changed the title Upgrade @aws-amplify/ui-react peerDependencies to support React 18 React 18 peer dependency errors from radix upstream dependencies Jun 17, 2022
@reesscot reesscot changed the title React 18 peer dependency errors from radix upstream dependencies React 18 peer dependency errors from radix dependencies Jun 17, 2022
@reesscot reesscot reopened this Aug 4, 2022
@adilosa
Copy link

adilosa commented Aug 6, 2022

Looks like radix-ui released the change in 1.0.0! radix-ui/primitives#1329 (comment)

Changelog: https://www.radix-ui.com/docs/primitives/overview/releases

@moltar
Copy link

moltar commented Aug 13, 2022

If on NPM > 8 you can use overrides.

  "overrides": {
    "@aws-amplify/ui-react": {
      "@radix-ui/react-accordion": "1.0.0",
      "@radix-ui/react-dropdown-menu": "1.0.0",
      "@radix-ui/react-slider": "1.0.0",
      "@radix-ui/react-tabs": "1.0.0"
    }
  }

@reesscot
Copy link
Contributor

@adilosa Thanks! Yes, we are working on upgrading to the 1.x release of the Radix UI components.
@moltar There are a few changes we are working through with the Menu and @radix-ui/react-dropdown-menu dependency, so you may not want to override @radix-ui/react-dropdown-menu quite yet.

Please follow this PR: #2411

@Milan-Shah Milan-Shah added the Primitive An issue or a feature-request for one or more UI Primitive label Sep 26, 2022
yotakeda added a commit to yotakeda/cognito-user-manager that referenced this issue Nov 21, 2022
@zchenwei
Copy link
Contributor

zchenwei commented Dec 1, 2022

Closes this since it was fixed by #2558

@zchenwei zchenwei closed this as completed Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Primitive An issue or a feature-request for one or more UI Primitive React An issue or a feature-request for React platform
Projects
None yet
6 participants