bhubr / react-simple-oauth2-login

Simple React component for OAuth2 login - Supports Authorization Code and Implicit Grant flows.
MIT License
49 stars 31 forks source link

Not working with react 18+ #55

Open alxnik opened 2 years ago

alxnik commented 2 years ago

It seems that the package has a dependency for react 16-17. Is this a matter of testing or are there breaking changes in react 18?

bhubr commented 2 years ago

Thank you for reporting. No, there are no actual reason for stating versions 16-17. It was just a quick change from the original version, which stated React 15.

desoss commented 1 year ago

@bhubr can the project start supporting react 18?

This is what we get:

npm ERR! Could not resolve dependency:
npm ERR! peer react@"16.0 - 17" from react-simple-oauth2-login@0.5.3
bhubr commented 1 year ago

@desoss OK I'm gonna have a little time after a long streak of work. I'll try and fix it ASAP.

bhubr commented 1 year ago

@desoss Sorry for the delay. I'm about to publish an update, but I'm having trouble with my NPM account, due to a problem with 2FA.

In the meantime I can propose you a workaround:

I hadn't stumbled upon this issue because I usually use Yarn instead of NPM. Yarn isn't as strict as NPM and lets you install "incompatible" peer dependencies with warnings instead of errors.

If you never used Yarn before:

  1. install it: npm i -g yarn
  2. in your React app's directory, run:

    • rm package-lock.json (remove NPM lockfile)
    • yarn (install dependencies with yarn)
    • yarn add react-simple-oauth2-login (install the lib)
desoss commented 1 year ago

Hey @bhubr, I managed to install it through yarn last week! I confirm that it works. So no hurries. Nevertheless, don't forget the npm support for newcomers.

bhubr commented 1 year ago

@desoss Hi!

I just published v0.5.4 which solves the problem. Instead of specifying a range such as 16-17, all React versions from 16 are now accepted.

Thank you again for reporting, and sorry @alxnik for not handling the issue earlier.

bhubr commented 1 year ago

@all-contributors please add @alxnik for bug

allcontributors[bot] commented 1 year ago

@bhubr

I've put up a pull request to add @alxnik! :tada:

bhubr commented 1 year ago

@all-contributors please add @desoss for bug

allcontributors[bot] commented 1 year ago

@bhubr

I've put up a pull request to add @desoss! :tada: