capacitor-community / stripe

Stripe Mobile SDK wrapper for Capacitor
https://capacitor-community-stripe.netlify.app/
MIT License
196 stars 77 forks source link

Error during initialization - Plugin does not support React 18 #207

Closed phal0r closed 2 years ago

phal0r commented 2 years ago

Platform

Describe the bug After adding CapacitorStripeProvider the following error is thrown:

Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:

  1. You might have mismatching versions of React and the renderer (such as React DOM)
  2. You might be breaking the Rules of Hooks
  3. You might have more than one copy of React in the same app See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.

To Reproduce Error is directly thrown in initialization, no additional steps necessary.

Expected behavior No error is thrown.

Additional context We are using React 18 and the plugin has a peer dependency on React 17, so I guess this is the problem as they seem to be incompatible.

rdlabo commented 2 years ago

Thanks issue, and sorry for late.

Maybe resolve is simple to change:

"react": "> 17.0.0"

@phal0r Can you create pull request??

phal0r commented 2 years ago

Probably. Yeah, I can check it.