Skip to content

race condition where grecaptcha is defined but not loaded #9

@KaseyPowers

Description

@KaseyPowers

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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions