hakkub
hakkub
TTCTheo's Typesafe Cult
Created by hakkub on 12/21/2022 in #questions
Does tRPC replace client-side form validation i.e react-hook-form?
As you know tRPC has input validation in the router, but if you wanted to still have client side validation in your actual form, should you still use something like react-hook-form? I looked at the docs, and it only shows a general error i.e <pre>Error: {JSON.stringify(mutation.error.data.zodError, null, 2)}</pre> Is there a way to display particular field errors from the mutation? Something like mutation.error.data.zodError.title for example. Thank you for your time.
5 replies