From b2ae438774f8d7e2c50da11e892203cce7ed63be Mon Sep 17 00:00:00 2001 From: Joshua C Alpuerto Date: Fri, 4 May 2018 13:01:14 +0800 Subject: [PATCH] [fixed] issue grecaptcha.render is not a function by adding condition --- src/recaptcha.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/recaptcha.js b/src/recaptcha.js index 91b36b8..2d88c57 100644 --- a/src/recaptcha.js +++ b/src/recaptcha.js @@ -49,7 +49,7 @@ export default class ReCAPTCHA extends React.Component { } explicitRender(cb) { - if (this.props.grecaptcha && this.state.widgetId === undefined) { + if (this.props.grecaptcha && this.props.grecaptcha.render && this.state.widgetId === undefined) { const wrapper = document.createElement("div"); const id = this.props.grecaptcha.render(wrapper, { sitekey: this.props.sitekey,