appleboy / react-recaptcha

A react.js reCAPTCHA for Google
https://www.google.com/recaptcha/intro/index.html
BSD 3-Clause "New" or "Revised" License
635 stars 97 forks source link

reCAPTCHA couldn't find user-provided function: onloadCallback #241

Open ochanje210 opened 6 years ago

ochanje210 commented 6 years ago

I have followed Explicitly render the reCAPTCHA widget and having the following message:

reCAPTCHA couldn't find user-provided function: onloadCallback
razvansandu commented 6 years ago

I've had the same issue and found two solutions:

  1. Add the onloadCallback function to window
  2. Remove the onload=onloadCallback part from the query string of the script you included in index.html
JaosnHsieh commented 6 years ago

I had the same problem started from these few days. It solved by @razvansandu comments. thanks.

jsardev commented 6 years ago

Maybe try making it more modern and react-way and use my new React reCAPTCHA wrapper library. I think you'll feel much better with it 😄 🚀

Library: https://github.com/sarneeh/reaptcha Example: https://sarneeh.github.io/reaptcha/

ghost commented 6 years ago

Hello razvansandu I have a question I have an issue like ochanje210. Could you explain your solution 1 in more detail? what is window? How do i have to add onloadCallback? please tell me about it in detail Thanks

varpenny commented 5 years ago

I've found a solution: just pass onloadCallback to the component, even if it is sometime not necessary to handle the onload event. version: 2.3.10

<Recaptcha sitekey="xxx" render="explicit" onloadCallback={() => console.log('loaded')} />

mwang7 commented 5 years ago

In your index.html you probably have this:

remove "onload=onLoadCallback"

should look like this:

That worked for me

EitsamShahzad commented 4 years ago

a

JozeHernandez commented 4 years ago

Tuve el mismo problema y removiendo "onload=onLoadCallback" del Query me funciono, como lo mencionan arriba. Mi query quedo :)

DanCanetti commented 3 years ago

In your index.html you probably have this:

remove "onload=onLoadCallback"

should look like this:

That worked for me

I had this loading in as <script src="https://www.google.com/recaptcha/api.js" async defer></script> and adding ?&render=explicit to the src worked for me. Thanks for this, I've been looking for a solution (using jQuery) for ages.

waliddeejay commented 3 years ago

brother just replace your script with this :100: