Luehang / react-paypal-button-v2

An easy and simple to use React button component to implement PayPal Checkout with Smart Payment Buttons V2 (Version 2).
https://luehangs.site/lue_hang/projects/react-paypal-button-v2
MIT License
274 stars 81 forks source link

[BUG] Doesn't work with React 18.0 #123

Open kamzata opened 2 years ago

kamzata commented 2 years ago

Software Package Version: 2.6.3

The buttons are loaded twice and I receive those errors on console. The buttons are loaded inside a MUI v5 modal window.

image

image

Desktop:

yashar98 commented 2 years ago

i can't instal package. npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree . . .

Nolazo commented 2 years ago

Yep, I got this err.

npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: merch-app@1.0.0 npm ERR! Found: react@18.2.0 npm ERR! node_modules/react npm ERR! react@"^18.2.0" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer react@"^0.14.6 || 15.x.x || 16.x.x || 17.x.x" from react-paypal-button-v2@2.6.3
npm ERR! node_modules/react-paypal-button-v2 npm ERR! react-paypal-button-v2@"*" from the root project

hrootscraft commented 2 years ago

image

Yes, trying to solve this error since a month now. Got the above with

npm list react

And getting the error below when trying to deploy on heroku image

ronTabachnik commented 2 years ago

same here...

ivanoats commented 1 year ago

Use npm install react-paypal-button-v2 --legacy-peer-deps until React 8 compatibility is specified.

randyumi commented 1 year ago

I think https://www.npmjs.com/package/@paypal/react-paypal-js is PayPal officially released library and implements what react-paypal-button-v2 doing. Is there anything not to be implemented by react-paypal-js?

devuxer commented 6 months ago

--legacy-peer-deps works, but it papers over all peer dep issues for your whole project, so this really isn't an ideal workaround.

It honestly looks like this library has been abandoned (no commits for 2 years).

@Luehang, if you can't support this anymore, can you let someone else take this over or provide a path forward for those using this library?

Meanwhile, I'll look into @paypal/react-paypal-js (thanks for the tip, @randyumi).