diff --git a/src/recaptcha.js b/src/recaptcha.js index 2746f7b..9f06c42 100644 --- a/src/recaptcha.js +++ b/src/recaptcha.js @@ -22,6 +22,8 @@ export default class ReCAPTCHA extends React.Component { if (grecaptcha && widgetId !== undefined) { return grecaptcha.execute(widgetId); + } else { + this._executeRequested = true; } } @@ -56,6 +58,10 @@ export default class ReCAPTCHA extends React.Component { widgetId: id, }, cb); } + if (this._executeRequested && this.props.grecaptcha && this.state.widgetId !== undefined) { + this._executeRequested = false; + this.execute(); + } } componentDidMount() {