ReactScriptLoader
ReactScriptLoader copied to clipboard
Change the name of StripeButton in the example
Just a little advice: change that name to something like ReactStripeButton
because checkout.js
defines StripeButton
, too, so when you build the React objects the first time all is fine (because stripe's script is loaded asynchronously), then if something happens that require to access again to the React object StripeButton
was pointing to (like a setState()
call), React throws exception (Uncaught TypeError: type.toUpperCase is not a function
).
Really a little nasty bug, it took my hours to figure out and fix it.
I'll be happy to make the change. Would you like to submit a diff?
Yep sure! Double check it since I didn't try it (my own code already diverged too much from this).
https://gist.github.com/dcaravana/4d9c2903f2ca2afa7e7b
BTW stripe module: https://github.com/azmenak/react-stripe-checkout