Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReCAPTCHA placeholder element must be an element or id #181

Closed
daywong1119 opened this issue Nov 6, 2016 · 6 comments
Closed

ReCAPTCHA placeholder element must be an element or id #181

daywong1119 opened this issue Nov 6, 2016 · 6 comments

Comments

@daywong1119
Copy link

I got the error when inflating the view by code below:

     <div className="form-group" id="captcha-holder">
        <Recaptcha sitekey="xxx" render="explicit" verifyCallback={this.onCaptchaVerify}/>
    </div>
recaptcha__en.js:286 Uncaught Error: ReCAPTCHA placeholder element must be an element or id
@MrHash
Copy link

MrHash commented Dec 15, 2016

Several people have this problem it seems. Any advice?

@marudhupandiyang
Copy link

Try adding onloadCallback to Recaptcha. Something similar to below

<div className="form-group" id="captcha-holder">
    <Recaptcha sitekey="xxx" render="explicit" verifyCallback={this.onCaptchaVerify} onloadCallback={this.onloadCallback}/>
</div>

@wil93
Copy link

wil93 commented Feb 18, 2017

I solved it by adding render="explicit" and onloadCallback={console.log.bind(this, "recaptcha loaded")}

I don't know why those two things (especially the onload thing) are required, but this check may be the cause of them being required:

if (this.props.render === 'explicit' && this.props.onloadCallback) {

@Daniel1971
Copy link

Thanks a lot, wil93.

@chris-allnutt
Copy link

chris-allnutt commented Jan 4, 2018

#186 doesn't fix this issue. The issue doesn't present itself on hard reloads, only soft reloads when the data is already cached.

Currently using v2.3.5

@JZebra
Copy link

JZebra commented Jul 17, 2019

I'm also having this issue in v2.3.11, but only in certain parts of my app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants