question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Execute doesn't work on invisible when recaptcha isn't cached

See original GitHub issue

I’m running execute on the ref returned by the callback to ReCAPTCHA. If it’s the second time (i.e. cached), execute() works. If recaptcha hasn’t been cached (e.g. first time in incognito), execute() does nothing.

After some analysis it seems to be because this.__executeRequested is undefined in explicitRender, even though it gets set in execute()… some kind of race condition?

Environment:

+-- react@15.6.1
+-- react-async-script@0.9.1
+-- react-dom@15.6.1
`-- react-google-recaptcha@0.9.6

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
harrysoercommented, Aug 23, 2018

I tried to reference the component and it seems working fine for me

recaptchaRef:any;

submitForm(e){
    e.preventDefault()
    this.recaptchaRef.execute()
}

render(){
    return(
        <form onSubmit={e=>this.submitForm}>
            <Recaptcha
                sitekey="==YOUR-SITEKEY=="
                ref={e => this.recaptchaRef = e}
                onChange={token => this.props.verifyCaptcha(token)}
                size={"invisible"}
           />
           <button class="btn btn-primary" type="submit" />
        </form>
   )
}
0reactions
hartziscommented, Aug 24, 2018

closing with update and 1.0.0 release. Please re-open if anyone is having an issue and include a codesandbox.io example if possible

Read more comments on GitHub >

github_iconTop Results From Across the Web

Invisible reCAPTCHA - Google Developers
Invoking the reCAPTCHA verification programmatically can be achieved by rendering the challenge in a div with an attribute data-size="invisible" ...
Read more >
Test invisible recaptcha - Stack Overflow
Go thru the steps to test the re-captcha with dev tools open. Go to the network tab and find ...
Read more >
FIX Recaptcha Not Working in Google Chrome [Tutorial]
FIX Recaptcha Not Working in Google Chrome [Tutorial]Several Chrome issues are having difficulties using reCAPTCHA from a Google Chrome ...
Read more >
Conflict with Invisible reCaptcha or WP_CACHE | WordPress.org
1. If WP Rocket is deactivated, by default, WP Rocket sets the WP_CACHE flag to FALSE (which is correct, as there's no cache)....
Read more >
Integrate Invisible reCAPTCHA option from Google - Drupal
The Invisible reCAPTCHA requires JavaScript and has no support for browsers without JavaScript enabled. This means the NOSCRIPT fallback no ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found