stripe-react-native icon indicating copy to clipboard operation
stripe-react-native copied to clipboard

"Cannot read property 'StripeProvider' of undefined" right after install

Open israelcrux opened this issue 1 year ago • 0 comments
trafficstars

Describe the bug Installed @stripe/stripe-react-native (0.35.1) on my expo (50.0.14) app by executing: expo install @stripe/stripe-react-native

I followed the instructions on https://github.com/stripe/stripe-react-native/tree/master and https://docs.stripe.com/apple-pay?platform=react-native

I'm experiencing this issue:

Cannot read property 'StripeProvider' of undefined

To Reproduce Steps to reproduce the behavior:

  1. Install the library expo install @stripe/stripe-react-native

  2. Add provider component to root

import { StripeProvider } from '@stripe/stripe-react-native';

//...

export const App: React.FC<AppProps> = ({ appName, theme }) => {

  // ...
    return (
      <StripeProvider
      publishableKey="pk_..."
      merchantIdentifier="merchant.com...."
    >
        <RootStackNavigator />
    </StripeProvider>
    );

};

  1. Launch the app
  2. See error

Expected behavior The app runs.

Screenshots Screenshot 2024-05-14 at 11 39 47 PM

Desktop (please complete the following information):

  • OS: Mac OS Sonoma 14.2.1

Smartphone (please complete the following information):

  • Device: iPhone 15 simulator and iPhone 13 pro iOS 17.2
  • OS: iOS 17.2

israelcrux avatar May 15 '24 07:05 israelcrux