#cbol-react-iframe
1 messages ยท Page 1 of 1 (latest)
I have a Stripe wrapper component:
export default function StripeWrapper(props) {
const stripePromise = loadStripe(process.env.REACT_APP_STRIPE_PK, {
locale: props.localeId === "frCa" ? "fr-CA" : "en",
});
return (
<Elements stripe={stripePromise}>
<SubscribeForm
createSubscription={props.createSubscription}
cancel={props.cancel}
translate={props.translate}
/>
</Elements>
);
}
I use this component inside my Subscription component.
The Subscription component is loaded using react router when you access a specific URL.
Even if I go to the home page of the site in a fresh browser, I will see a Stripe iframe:
๐ I'm hopping in! Give me a few minutes to take a look
Hi! take your time, you guys being available to help is so great, I'm not in a hurry.
Have you looked into using loadStripe without side effects (https://github.com/stripe/stripe-js/blob/90715ceb9fb510810db85abf4fdfab8a59d5c1f6/README.md#importing-loadstripe-without-side-effects) ? This would allow you to delay loading Stripe.js only it's needed
I will have a look, never seen this before. Thank you!