react-google-recaptcha
react-google-recaptcha copied to clipboard
Suggest Idea: Event handle for async load
Hi, thanks a lot for your work on this. I just have a suggest, maybe add a event to handle when the captcha script loads correctly or/and a timeout (in case of internet problems)
<ReCAPTCHA
ref="recaptcha"
sitekey="6LcYNzMUAAAAAOgeebqBLFCOIFSKmCsSTkSUNwWk"
onLoad={this.handleOnLoad}
onTimeout={this.handleTimeout}
onChange={this.onCaptcha}
/>
So, it's not documented directly on the ReCAPTCHA but since the component is wrapped in react-async-script you should be able to pass asyncScriptOnLoad for the onload.
I can try getting a fix in for the timeout, but if you need the feature right now I would advise you to go ahead open a pr on https://github.com/dozoisch/react-async-script to ahead the parameter! Something like asyncScriptOnTimeout