Open davidbielik opened 3 days ago
Hmm I can see how that would be convenient for your flow, though for how I've pictured your integration tracking the embedded Checkout state I think makes sense. Does it also work to wrap your call to destroy
in a try/catch?
Thanks, yes that works. Just wanted to pass along the (minor) feedback, as this was an area that caused confusion. I assumed I could safely call instance?.destroy()
any time I wanted to call initEmbeddedCheckout
.
What happened?
@stripe/stripe-js": "^3.0.3
My integration has two logical places where I destroy an embedded checkout instance (if a user goes to another page, or if a user clicks to go back to pricing plans and hide the embedded checkout).
I call
instance.destroy()
and create new instances which works as expected, but callingdestroy
twice results in an error message.It would be great if you allowed calling
destroy
on an already destroyed instance. If not possible for some reason, it would be helpful to have access to theembeddedCheckout.isDestroyed
property in the typescript definitions somehow.I was able to find a workaround (not ideal passing more state around) but would have saved time if this worked more seamlessly.
Environment
No response
Reproduction
No response