renderCaptcha() { const recpatcha = window['grecaptcha']; console.log(typeof recpatcha.render); if (typeof recpatcha.render !== "function") { console.log('waiting till captcha is found'); this.timeout = setInterval(() => { this.renderCaptcha(); }, 200) return; } clearTimeout(this.timeout); recpatcha.render(this.element.shadowRoot.querySelector('#captcha'), { sitekey: '6Lf_op4UAAAAANXxRYbfMkXbR4CnXwI520y9JiWc', callback: function(response){ console.log('got cpatch response', response); } }); } componentDidLoad() { this.renderCaptcha(); }