How to process extra errors? #10779
Unanswered
evgeniyworkbel
asked this question in
Q&A
Replies: 2 comments 1 reply
-
HELP |
Beta Was this translation helpful? Give feedback.
0 replies
-
Please provide a minimal re-producible codesandbox. Plus, attach or upload file should be handled via |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
`I have a form. Inputs are handled by react-hook-form, but there is feature like attaching files to form. And I have different checkings for it like file count, result file total size and etc. How to process errors? Is it good to create hidden input and manually set error to it?
There was troubles if I saved extra error in useState() hook - it's difficult to synchronize this state and form state handled by RHF. For example, I reset form and depend on isSub,isSubmitSuccessful predicate in useEffect(). But if I have extra errors which saved in useState() they are out of sync with each other. It will be better if extra errors is going to validate by RHF.
Some piece of code (handler onSubmit and effect) to understand you better my case:
Beta Was this translation helpful? Give feedback.
All reactions