Invisible captcha badge not rendering again after just unmounting
See original GitHub issuereact-google-recaptcha version: 2.0.1
export const ReCaptcha = memo(function Recaptcha({ onChange }) {
const recaptchaRef = useRef();
function handleError(err) {
console.log("Error in recaptcha", err);
}
return (
<ReCAPTCHA
ref={recaptchaRef}
sitekey={RECAPTCHA_SITE_KEY}
size="invisible"
badge="bottomright"
onChange={onChange}
onErrored={handleError}
/>
);
});
Here is my wrapper on recaptcha. I render this inside a div
and the content inside the div
unmounts and mounts on a certain user action.
Issue is if the content inside mounted immediately after unmounting, then invisible captcha works fine but the badge doesnt render, rather it is hidden
and renders inline but hidden. But if it is mounted after 5-6 seconds after unmounting, then it renders at bottomright
of div
.
What i have tried:
useEffect(()=>{
setTimeout(() => {window.grecaptcha.reset();}, 1000)
}, [])
If i run from browser console window, it resets and captcha is rendered agains, but doing it on mount is not working.
Any help would be much appreciated.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:9
- Comments:8
Top Results From Across the Web
Google "reCaptcha" sometimes doesn't get displayed/rendered
This problem appeared with me in google maps when initializing the map on hidden div (e.g. a modal). I'd solve this problem by...
Read more >Frequently Asked Questions | reCAPTCHA - Google Developers
Simply use the JavaScript API to explicitly render reCAPTCHA with a v3 site key to access options such as repositioning the badge or...
Read more >Google no Captcha + INVISIBLE reCaptcha - TehnoBlog
Google now officially allows hiding the reCaptcha badge IF AND ONLY IF you post this text below the submit/sign-in/registration/comment/etc.
Read more >react-google-recaptcha - Bountysource
Invisible captcha badge not rendering again after just unmounting $ 0. Created 2 years ago in dozoisch/react-google-recaptcha with 8 comments. react-google- ...
Read more >react-google-recaptcha | Yarn - Package Manager
With the invisible option, you need to handle things a bit differently. You will need to call the execute method yourself. import ReCAPTCHA...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hello everybody! Does anyone found a fix to this issue?
@cw-amitsingh ХО-amitsingh it helped me