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.

After selecting all the correct images the captcha shows you, the recaptcha doesn't get re-rendered with a pass (green check)

See original GitHub issue

I’m adding a <ReCaptcha /> component inside a redux-forms <Field /> component, the below <Field /> component is returned by the render function of the myForm component I have:

<Field name='captcha' size="normal" theme="dark" component={(formProps) => this.renderReCaptcha(formProps)} />

This is my renderReCaptcha function that returns the <ReCaptcha /> component:

renderReCaptcha = (formProps) => {
    return(
      <div>
        <ReCaptcha
            ref={(ref) => {this.captcha = ref;}}
            size={formProps.size}
            theme={formProps.theme}
            sitekey="<SOME-KEY>"
            onChange={this.onChange}
        />
      </div>
    );
  }

After selecting all the correct images the captcha shows you and clicking ‘Verify’, I get a recaptchaToken back which means it passed, however, the recaptcha doesn’t get re-rendered with a pass (green check) like below:

image

instead it goes back to:

image

Is that what’s supposed to happen?. On the codesandbox.io example as soon as you click on it it goes to:

image

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
dozoischcommented, Feb 27, 2019

Using Reatc.PureComponent and/or the lifecycle shouldComponentUpdate is the way to do it.

https://reactjs.org/docs/react-api.html#reactpurecomponent

The re-render should not be an issue. The problem is the component unmounting and remounting. You have something in your component tree somewhere that gets a different key that causes a full remount

1reaction
vascojm82commented, Feb 27, 2019

Thanks a lot for your help @dozoisch.

Read more comments on GitHub >

github_iconTop Results From Across the Web

reCAPTCHA Help - Google Support
Official reCAPTCHA Help Center where you can find tips and tutorials on using reCAPTCHA and other answers ... If you see a green...
Read more >
How to Fix Captcha Image Not Showing in Google Chrome?
Learn how to fix captcha image not showing in Google Chrome and load the image so that you can login or submit form...
Read more >
FIX Recaptcha Not Working in Google Chrome [Tutorial]
ReCaptcha will actively look at the browser version before allowing you access. This is applicable to all browser versions, not just Chrome.
Read more >
How to FIX Recaptcha Not Working in Google Chrome
How to resolve reCAPTCHA not working in Google Chrome browser? in Windows 10 / Windows 11. Fixed: Google Chrome ReCAPTCHA Not Working ...
Read more >
reCAPTCHA Not Working - Restream Help Center
Here are potential reasons why reCAPTCHA is not working for you ‍ . Chrome is not updated to the latest version. One...
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