import {useFormikContext} from "formik";
import {useEffect} from "react";

const AutoSubmit = () => {
    const {values, submitForm} = useFormikContext()
    useEffect(() => {
        if (values.verification_code.length === 6) {
            submitForm();
        }
    }, [values, submitForm]);
};

export default AutoSubmit;
