Skip to content

Is there a way to get all the error messages for a given form generically? #11698

Answered by Haschikeks
jim-moody asked this question in Q&A
Discussion options

You must be logged in to vote

Hey,

error is a Object. So you could use methods like Object.values(errors) to access all of them.

<ul>
  {Object.values(errors).map((error) => (
    <li>{error.message}</li>
  ))}
</ul>

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@sneko
Comment options

@kcsujeet
Comment options

@sneko
Comment options

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