From 3a2db6f090821fd0bff8c7258283050552046417 Mon Sep 17 00:00:00 2001 From: Kristofer Koishigawa Date: Thu, 17 Oct 2019 23:57:37 +0900 Subject: [PATCH] fix: Bound handleStripeLoad to this in the constructor to prevent setState is not a function errors (#37371) --- client/src/components/Donation/components/DonateModal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/components/Donation/components/DonateModal.js b/client/src/components/Donation/components/DonateModal.js index b39ae0f02c..ecfe6f3ae0 100644 --- a/client/src/components/Donation/components/DonateModal.js +++ b/client/src/components/Donation/components/DonateModal.js @@ -48,6 +48,7 @@ class DonateModal extends Component { stripe: null }; this.renderMaybe = this.renderMaybe.bind(this); + this.handleStripeLoad = this.handleStripeLoad.bind(this); } componentDidMount() { if (window.Stripe) { @@ -63,7 +64,6 @@ class DonateModal extends Component { handleStripeLoad() { // Create Stripe instance once Stripe.js loads - console.info('stripe has loaded'); this.setState(state => ({ ...state, stripe: window.Stripe(stripePublicKey)