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

race condition where grecaptcha is defined but not loaded #9

Open
KaseyPowers opened this issue May 23, 2018 · 1 comment
Open

race condition where grecaptcha is defined but not loaded #9

KaseyPowers opened this issue May 23, 2018 · 1 comment

Comments

@KaseyPowers
Copy link

It looks like during the loading process grecaptcha is created as an object with a ready function before it tries calling the onLoad callback.

this means with bad luck,
https://github.com/twobucks/react-gcaptcha/blob/master/src/index.js#L24
this will attempt to render before grecaptcha is ready.

I'm not able to recreate locally, so I can't tell if it would be too late to add the callback to window if doing something like if (typeof grecaptcha !== "undefined" && grecapthca.render)

@dinodsaurus
Copy link
Member

Thanks for this @KaseyPowers feel free to submit a PR ;)

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

No branches or pull requests

2 participants