function resetCaptcha() {
if (turnstileRef.current) {
turnstileRef.current?.reset()
}
}
function onExpire() {
setCaptchaToken(null)
turnstileRef.current?.reset()
}
Can you provide a repo or codesandbox with your error? Here is an example of a form with a turnstile widget, which resets after a form submission. With Next.js. Let me know if this helps you.
Thank you for this library. I am trying to reset the captcha after a form submission, but the reference to the turnstile widget is always null.
const turnstileRef = useRef(null);
This is my resetting logic-