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

fix(deps): enable react ^18 in peerDeps #11826

Closed

Conversation

falsepopsky
Copy link
Contributor

Summary

When you are working with react + react-dom version ">=18" and you try to install this package @carbon/react npm throw an error, like this

Could not resolve dependency:
npm ERR! peer react@"^16.8.6 || ^17.0.1" from @carbon/react@1.7.0

So you have 2 options

  1. Install like this with -flag:
npm i @carbon/react --legacy-peer-deps
  1. Update peerDependencies in package.json in react and carbon-components-react packages

To reproduce this error copy the example next folder outside from the monorepo, run npm install and you will see the error make sure you don't run --legacy-peer-deps flag.

New

  • Support react >=18

Changed

  • peerDependencies

Removed

  • {{removed thing}}

Testing / Reviewing

@falsepopsky falsepopsky requested a review from a team as a code owner July 18, 2022 21:47
@github-actions
Copy link
Contributor

github-actions bot commented Jul 18, 2022

DCO Assistant Lite bot All contributors have signed the DCO.

@netlify
Copy link

netlify bot commented Jul 18, 2022

Deploy Preview for carbon-components-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit fe6a366
🔍 Latest deploy log https://app.netlify.com/sites/carbon-components-react/deploys/62d998c4733f970008150083
😎 Deploy Preview https://deploy-preview-11826--carbon-components-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Jul 18, 2022

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit fe6a366
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/62d998c43e3cef0008c35051
😎 Deploy Preview https://deploy-preview-11826--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@falsepopsky
Copy link
Contributor Author

I have read the DCO document and I hereby sign the DCO.

@dakahn dakahn requested a review from tay1orjones July 26, 2022 20:46
@dakahn
Copy link
Contributor

dakahn commented Jul 26, 2022

@tay1orjones adding a third set of eyes on this change

@tay1orjones
Copy link
Member

Hi there @falsepopsky! Thanks for proposing this change. Unfortunately we haven't finished formal support for React 18 yet and so can't merge this until we land #11308

The two workarounds you listed are the recommended path for now until we can validate React 18 support within the project.

@falsepopsky falsepopsky deleted the react-deps-18 branch July 27, 2022 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

4 participants