Open KaseyPowers opened 6 years ago
It looks like during the loading process grecaptcha is created as an object with a ready function before it tries calling the onLoad callback.
ready
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)
if (typeof grecaptcha !== "undefined" && grecapthca.render)
Thanks for this @KaseyPowers feel free to submit a PR ;)
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)