FortAwesome / react-fontawesome

Font Awesome React component
https://fontawesome.com
MIT License
3.67k stars 264 forks source link

React 18 support #496

Closed mike-dean-talis closed 2 years ago

mike-dean-talis commented 2 years ago

Is your feature request related to a problem? Please describe. react-fontawesome doesn't seem to support React 18, which is currently in RC2.

Additional context Currently, updating package.json to 18.0.0-rc2 produces the following npm error.

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: otis-app@0.1.0
npm ERR! Found: react@18.0.0-rc.2
npm ERR! node_modules/react
npm ERR!   react@"18.0.0-rc.2" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@">=16.x" from @fortawesome/react-fontawesome@0.1.17
npm ERR! node_modules/@fortawesome/react-fontawesome
npm ERR!   @fortawesome/react-fontawesome@"0.1.17" 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.
WhiteAdy commented 2 years ago

I just started a new React 18 RC3 project and got surprised by this too. Hoping it gets supported soon!

robmadole commented 2 years ago

Since you are using a pre-release version the version spec we have "react": ">=16.x" doesn't include pre-releases. Can you use --force?

SuspenseFallback commented 2 years ago

I'm also getting this error with primereact -

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: primereact@7.2.1
npm ERR! Found: react@18.0.0
npm ERR! node_modules/react
npm ERR!   peer react@">=16.x" from @fortawesome/react-fontawesome@0.1.17
npm ERR!   node_modules/@fortawesome/react-fontawesome
npm ERR!     @fortawesome/react-fontawesome@"^0.1.17" from the root project
npm ERR!   peer react@"*" from @testing-library/react@12.1.2
npm ERR!   node_modules/@testing-library/react
npm ERR!     @testing-library/react@"^12.1.2" from the root project
npm ERR!   18 more (chessboardjsx, formik, react-dnd, react-dnd, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^17.0.1" from primereact@7.2.1
npm ERR! node_modules/primereact
npm ERR!   primereact@"^7.2.1" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: react@17.0.2
npm ERR! node_modules/react
npm ERR!   peer react@"^17.0.1" from primereact@7.2.1
npm ERR!   node_modules/primereact
npm ERR!     primereact@"^7.2.1" 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 /Users/krithinpakshootra/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/krithinpakshootra/.npm/_logs/2022-04-05T01_20_53_243Z-debug-0.log

I can't install or uninstall anything either.

SuspenseFallback commented 2 years ago

And now React 18.0.0 has been released, so it isn't a pre-release version.

robmadole commented 2 years ago

I'll close then. @mike-dean-talis if you are still having issues let me know.