Skip to content

Support for React 18 #1179

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

Closed
kolban-google opened this issue May 30, 2022 · 2 comments · Fixed by #1180
Closed

Support for React 18 #1179

kolban-google opened this issue May 30, 2022 · 2 comments · Fixed by #1180

Comments

@kolban-google
Copy link

I tried to install react-json-tree on my React 18 environment and it failed. Do we have plans for a React 18 release?

$ npm i react-json-tree
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!   react@"^18.1.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.3.0 || ^17.0.0" from [email protected]
npm ERR! node_modules/react-json-tree
npm ERR!   react-json-tree@"*" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /home/kolban/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/kolban/.npm/_logs/2022-05-30T03_52_27_323Z-debug-0.log
@FaberVitale
Copy link
Contributor

Hi @kolban-google,

Have you tried to change the react-json-tree peer dependencies using patch-package?

  "peerDependencies": {
-   "@types/react": "^16.3.0 || ^17.0.0",
-    "react": "^16.3.0 || ^17.0.0"
+   "@types/react": "^16.3.0 || ^17.0.0  || ^18.0.0",
+   "react": "^16.3.0 || ^17.0.0  || ^18.0.0"
  }

Can you please report if it works?

@Methuselah96 we should consider a gradual migration to functional components and add react-18 as peer dependency.
We could start from smaller libs: react-json-tree for instance :).

@Methuselah96
Copy link
Member

Methuselah96 commented May 30, 2022

Yeah, I was hoping to upgrade the devDependencies to React 18 at the same time here, but there's still a few packages that we depend on with old peerDependencies. I'll create a PR to just update the peerDependencies for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants