From 37bd0697667a3cba422adf50a7fb15527a6f2ab8 Mon Sep 17 00:00:00 2001 From: Ben Gotow Date: Mon, 7 Nov 2016 14:07:05 -0800 Subject: [PATCH] fix(newsletter): Use bound functions for callbacks, always. --- src/components/newsletter-signup.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/newsletter-signup.jsx b/src/components/newsletter-signup.jsx index 63685b537..a8aeaf8c9 100644 --- a/src/components/newsletter-signup.jsx +++ b/src/components/newsletter-signup.jsx @@ -35,7 +35,7 @@ export default class NewsletterSignup extends React.Component { this.setState(state); } - _onGetStatus(props = this.props) { + _onGetStatus = (props = this.props) => { this._setState({status: 'Pending'}); EdgehillAPI.makeRequest({ method: 'GET', @@ -53,7 +53,7 @@ export default class NewsletterSignup extends React.Component { }); } - _onSubscribe() { + _onSubscribe = () => { this._setState({status: 'Pending'}); EdgehillAPI.makeRequest({ method: 'POST', @@ -67,7 +67,7 @@ export default class NewsletterSignup extends React.Component { }); } - _onUnsubscribe() { + _onUnsubscribe = () => { this._setState({status: 'Pending'}); EdgehillAPI.makeRequest({ method: 'DELETE',