stripe-react-native
stripe-react-native copied to clipboard
"Cannot read property 'StripeProvider' of undefined" right after install
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:
-
Install the library
expo install @stripe/stripe-react-native -
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>
);
};
- Launch the app
- See error
Expected behavior The app runs.
Screenshots
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