diff --git a/components/Captcha/Captcha.tsx b/components/Captcha/Captcha.tsx index 46853324..a7d45cab 100644 --- a/components/Captcha/Captcha.tsx +++ b/components/Captcha/Captcha.tsx @@ -28,7 +28,7 @@ const Captcha = ({ size = "normal", theme, className, ...rest }: CaptchaProps) =
{hasMounted && ( { // status/feedback: const [submitted, setSubmitted] = useState(false); - const [success, setSuccess] = useState(null); + const [success, setSuccess] = useState(false); const [feedback, setFeedback] = useState(""); const handleSubmit = (values: Values, { setSubmitting }: FormikHelpers) => { @@ -197,7 +197,7 @@ const ContactForm = ({ className }: ContactFormProps) => { "h-captcha-response": "", }} validate={(values: Values) => { - const errors: { name?: boolean; email?: boolean; message?: boolean; "h-captcha-response"?: boolean } = {}; + const errors: Partial> = {}; errors.name = !values.name; errors.email = !values.email; // also loosely validated that it's email-like via browser (not foolproof) @@ -206,7 +206,7 @@ const ContactForm = ({ className }: ContactFormProps) => { if (!errors.name && !errors.email && !errors.message && !errors["h-captcha-response"]) { setFeedback(""); - return null; + return {}; } else { setSuccess(false); setFeedback("Please make sure that all fields are properly filled in."); @@ -218,6 +218,7 @@ const ContactForm = ({ className }: ContactFormProps) => { {({ setFieldValue, isSubmitting }) => (
+ {/* @ts-ignore */} {({ field, meta }) => ( { + {/* @ts-ignore */} {({ field, meta }) => ( { + {/* @ts-ignore */} {({ field, meta }) => (