我没有得到谷歌 reCaptcha 对话框来验证是否在 ReactJs 中。我在这里错过了什么?

问题描述 投票:0回答:0

onChange 函数

let captcha;

onchange 函数

    function onchange(value) {
    window.value.reset();
}

    const setCaptchaRef = (ref) => {
        if (ref) {
            return captcha = ref;
        }
    };

    const resetCaptcha = () => {
        // maybe set it till after is submitted
        captcha.reset();
    }

reCaptcha 组件内部。

<ReCAPTCHA sitekey="" ref={(r) => setCaptchaRef(r)} onChange={onChange(() => resetCaptcha())} />
javascript reactjs recaptcha
© www.soinside.com 2019 - 2024. All rights reserved.