Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Expose InvalidSubmissionHandler and GenericValidateFunction types #3853

Merged
merged 1 commit into from Jul 24, 2022
Merged

feat: Expose InvalidSubmissionHandler and GenericValidateFunction types #3853

merged 1 commit into from Jul 24, 2022

Conversation

bgoscinski
Copy link
Contributor

@bgoscinski bgoscinski commented Jul 21, 2022

πŸ”Ž Overview

This PR exports InvalidSubmissionHandler and GenericValidateFunction types to make the following possible.

πŸ€“ Code snippets/examples (if applicable)

const customValidator: GenericValidateFunction = (val, ctx) => {}
//                     ^^^^^^^^^^^^^^^^^^^^^^^

const { handleSubmit } = useForm<Form>(/* ... */)

const submit: SubmissionHandler<Form> = (form, ctx)  => {}

const handleInvalidSubmit: InvalidSubmissionHandler<Form> = (ctx) => {}
//                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

const triggerSubmit = handleSubmit(submit, handleInvalidSubmit)

βœ” Issues affected

@logaretm logaretm merged commit 3ccf27d into logaretm:main Jul 24, 2022
@logaretm
Copy link
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants