我正在使用 react-google-recaptcha 包
我不知道你尝试了什么。我希望它能转移到我的代码的下一部分
这是部分代码:
// what code is returning
<ReCAPTCHA
sitekey={RECAPTCHA_SITE_KEY}
size="invisible"
ref={recaptchaRef}
/>
//Handle submit
async function handleSubmit(event) {
event.preventDefault()
const key = await recaptchaRef.current.executeAsync()
...
使用后需要重置验证码
executeAsync
。
async function handleSubmit(event) {
event.preventDefault()
const key = await recaptchaRef.current.executeAsync()
recaptchaRef.current.reset()