on #react-hook-usegooglerecaptcha-recommended-approach
we need to add executeRecaptcha as dependency on useCallback, executeRecaptcha is not defined at first
new code
// Create an event handler so you can call the verification on button click event or form submit
const handleReCaptchaVerify = useCallback(async () => {
if (!executeRecaptcha) {
console.log("Execute recaptcha not yet available");
return;
}
const token = await executeRecaptcha("yourAction");
// Do whatever you want with the token
console.log({ token });
}, [executeRecaptcha]); // adding executeRecaptcha as dependency
on
#react-hook-usegooglerecaptcha-recommended-approach
we need to add executeRecaptcha as dependency on useCallback, executeRecaptcha is not defined at first
new code