Skip to content
This repository has been archived by the owner on Sep 21, 2023. It is now read-only.

Add support for react 18 #508

Open
SebastiaanNijland opened this issue Apr 18, 2022 · 12 comments
Open

Add support for react 18 #508

SebastiaanNijland opened this issue Apr 18, 2022 · 12 comments

Comments

@SebastiaanNijland
Copy link

SebastiaanNijland commented Apr 18, 2022

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.
@Infinitay
Copy link

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: my-app@0.1.0
npm ERR! Found: react@18.0.0
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 react-google-login@5.2.2
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

@ecoulson
Copy link

ecoulson commented May 9, 2022

Bump

@sumeyradavran
Copy link

Same

@bautista1405
Copy link

Same.

@bautista1405
Copy link

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: react-google-login@5.2.2
npm WARN Found: react@18.1.0
npm WARN node_modules/react
npm WARN peer react@">=16.8.0" from @nextui-org/react@1.0.0-beta.6
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 react-google-login@5.2.2
npm WARN node_modules/react-google-login
npm WARN react-google-login@"" from the root project
npm WARN
npm WARN Conflicting peer dependency: react@17.0.2
npm WARN node_modules/react
npm WARN peer react@"^16 || ^17" from react-google-login@5.2.2
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: react-google-login@5.2.2
npm WARN Found: react-dom@18.1.0
npm WARN node_modules/react-dom
npm WARN peer react-dom@">=16.8.0" from @nextui-org/react@1.0.0-beta.6
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 react-google-login@5.2.2
npm WARN node_modules/react-google-login
npm WARN react-google-login@"" from the root project
npm WARN
npm WARN Conflicting peer dependency: react-dom@17.0.2
npm WARN node_modules/react-dom
npm WARN peer react-dom@"^16 || ^17" from react-google-login@5.2.2
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

@itsjinendrajain
Copy link

same here

@senkiv-n
Copy link

+1

@MomenSherif
Copy link

you can check @react-oauth/google

@ameyalambat128
Copy link

I'd love to see a version compatible with React 18!

@leecheuk
Copy link

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.

@GH0ST555
Copy link

Has this issue been resolved? As I got the same error but used @leecheuk's solution. Thx btw

@SebastiaanNijland
Copy link
Author

Looks like this repo is no longer maintained

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

No branches or pull requests