Skip to content
Discussion options

You must be logged in to vote

It would be more interesting to pass an onSubmit function to the formProvider and that this function be executed after the blur event of an input is triggerd (only if the validation is valid), or am I totally wrong?

Somethig like this :

const useFormProps = useForm({
        defaultValues: {url: ''},
        mode: 'onBlur',
        onSubmit: () => {
            console.log('function triggered after blur and validation valid')
        },
        resolver: joiResolver(Joi.object({
            url: Joi.string().uri({scheme: ['https']}),
        })),
    });

Replies: 2 comments 10 replies

Comment options

You must be logged in to vote
4 replies
@piotr-sobczyk
Comment options

@bluebill1049
Comment options

@piotr-sobczyk
Comment options

@pprob
Comment options

Comment options

You must be logged in to vote
6 replies
@squiaios
Comment options

@younessdev9
Comment options

@Moshyfawn
Comment options

@nathanmlui
Comment options

@carlos-lopez-SaRa
Comment options

Answer selected by bluebill1049
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
8 participants