react-google-login
react-google-login copied to clipboard
Add support for react 18
When trying to upgrade to react 18, we are running into this Error:
error TS2786: 'GoogleLogin' cannot be used as a JSX component.
Its instance type 'GoogleLogin' is not a valid JSX element.
The types returned by 'render()' are incompatible between these types.
Type 'import("/drone/src/node_modules/@types/react-transition-group/node_modules/@types/react/index").ReactNode' is not assignable to type 'React.ReactNode'.
error Command failed with exit code 2.
I can't properly install react-google-login
alongside React v18. I have tried using the legacy-peer-deps
flag but it resulted in more issues down the line with my other modules. Adding support for React's new version would be appreciated.
>npm i react-google-login
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.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16 || ^17" from [email protected]
npm ERR! node_modules/react-google-login
npm ERR! react-google-login@"*" 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 ...\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! ...\AppData\Local\npm-cache\_logs\2022-04-19T07_08_54_572Z-debug-0.log
Bump
Same
Same.
Same.
I could install it with the "--force" flag. Below I leave the logs:
$ npm install react-google-login --force npm WARN using --force Recommended protections disabled. npm WARN ERESOLVE overriding peer dependency npm WARN While resolving: [email protected] npm WARN Found: [email protected] npm WARN node_modules/react npm WARN peer react@">=16.8.0" from @nextui-org/[email protected] npm WARN node_modules/@nextui-org/react npm WARN @nextui-org/react@"^1.0.0-beta.6" from the root project npm WARN 6 more (@stitches/react, formik, next, react-dom, styled-jsx, the root project) npm WARN npm WARN Could not resolve dependency: npm WARN peer react@"^16 || ^17" from [email protected] npm WARN node_modules/react-google-login npm WARN react-google-login@"" from the root project npm WARN npm WARN Conflicting peer dependency: [email protected] npm WARN node_modules/react npm WARN peer react@"^16 || ^17" from [email protected] npm WARN node_modules/react-google-login npm WARN react-google-login@"" from the root project npm WARN ERESOLVE overriding peer dependency npm WARN While resolving: [email protected] npm WARN Found: [email protected] npm WARN node_modules/react-dom npm WARN peer react-dom@">=16.8.0" from @nextui-org/[email protected] npm WARN node_modules/@nextui-org/react npm WARN @nextui-org/react@"^1.0.0-beta.6" from the root project npm WARN 2 more (next, the root project) npm WARN npm WARN Could not resolve dependency: npm WARN peer react-dom@"^16 || ^17" from [email protected] npm WARN node_modules/react-google-login npm WARN react-google-login@"" from the root project npm WARN npm WARN Conflicting peer dependency: [email protected] npm WARN node_modules/react-dom npm WARN peer react-dom@"^16 || ^17" from [email protected] npm WARN node_modules/react-google-login npm WARN react-google-login@"" from the root project
added 5 packages, and audited 384 packages in 4s
68 packages are looking for funding
run npm fund
for details
found 0 vulnerabilities
same here
+1
you can check @react-oauth/google
I'd love to see a version compatible with React 18!
While we wait for this, hopefully this helps.
npm uninstall react-google-login
npm install @leecheuk/react-google-login
@leecheuk/react-google-login
is a fork of anthonyjgrove/react-google-login
and has plugin_name
support & updated peerDependency
for React 18.
Has this issue been resolved? As I got the same error but used @leecheuk's solution. Thx btw
Looks like this repo is no longer maintained