stripe-react-native
stripe-react-native copied to clipboard
Can we add @stripe/stripe-react-native package for React native web version will it support?
No. At least, when it's used with:
"@stripe/stripe-react-native": "0.6.1"
"react-native": "0.68.2"
"react-native-web": "0.17.7"
the lib is causing error: "Cannot read properties of undefined (reading 'setGlobalHandler')
any ideas if there are plans to support web? what is missing for it to work?
The workaround (solution?) that I saw was add to Stripe for React JS (web SDK) to your React Native app and then write your own platform specific utilities / wrappers e.g. in a files called
stripe.tsx- for iOS, android, etc that uses imports from React Native SDKstripe.web.tsxfor web that uses imports from Stripe ReactJS (web SDK)
The bundler would pick the correct file for your platform. However, the both files need to implement the same interface or you would need to use branching in your code (e.g. if (Platform.OS == "web") {} else {})
The workaround (solution?) that I saw was add to Stripe for React JS (web SDK) to your React Native app and then write your own platform specific utilities / wrappers e.g. in a files called
stripe.tsx- for iOS, android, etc that uses imports from React Native SDKstripe.web.tsxfor web that uses imports from Stripe ReactJS (web SDK)The bundler would pick the correct file for your platform. However, the both files need to implement the same interface or you would need to use branching in your code (e.g.
if (Platform.OS == "web") {} else {})
does this work for expo apps?
Is there an example of this?