import {useEffect} from 'react'

export default function Effect(props) {
    const {submitCount, isValid} = props.formik
    const effect = () => {
        if(submitCount > 0 && !isValid){
            props.onSubmissionError()
        }
    }
    useEffect(effect, [submitCount])
    return null
}