Closed AlphaSteam closed 2 months ago
Thanks @AlphaSteam for using our library, we were not only able to remove the warning, but also fixed 'expired-callback' and 'error-callback', they did not work before
You can check this in release 1.0.4 of react package
Hi! Thanks for answering.
The error is gone with expired and error callbacks and they are working.
I'm still getting the error with callback though. It says Invalid value for prop "callback" on <div> tag
and the callback is not working.
Here is my current implementation
<GoogleReCaptchaCheckbox
{...props}
callback={(token)=>{
localStorage.setItem('recaptcha-v2-token', token);
if (callback) callback();
}}
expiredCallback={()=>{
localStorage.removeItem('recaptcha-v2-token');
if (expiredCallback) expiredCallback();
}}
errorCallback={()=>{
localStorage.removeItem('recaptcha-v2-token');
if (errorCallback) errorCallback();
}}
/>```
Hi, this is very strange because when typing a checkbox there is no callback anymore, you need to use onChange
When passing callback or expiredCallback to the GoogleReCaptchaCheckbox component the errors:
Invalid value for prop `callback` on <div> tag. Either remove it from the element, or pass a string or number value to keep it in the DOM
and
Warning: React does not recognize the `expiredCallback` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `expiredcallback` instead. If you accidentally passed it from a parent component, remove it from the DOM element.
Are shown respectively.
This happens because in GoogleReCaptchaCheckbox there's a
{...props}
in the div.