Skip to content

Is it possible to receive field errors from onSubmit failure responses? #623

Answered by crutchcorn
lnhrdt asked this question in Ideas
Discussion options

You must be logged in to vote

Good question @lnhrdt! (And sincere thanks for the patient tone with us as we figure out how to communicate this)

So if we think about how onSubmit is structured internally the code looks something like:

  • Run validators.onSubmit sync validation
  • Run validators.onSubmit async validation
  • Run onSubmit if both don't have errors

Because of this, the idea is that all errors should be passed through our validators and only the successful logic should be in onSubmit

To be clear; we can still use your server's validation using the new feature + onSubmitAsync to handle the error setting internally for you rather than having to do things manually

Replies: 2 comments 10 replies

Comment options

You must be logged in to vote
10 replies
@crutchcorn
Comment options

@crutchcorn
Comment options

@lnhrdt
Comment options

@crutchcorn
Comment options

Answer selected by lnhrdt
@lnhrdt
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
6 participants