Help in Server-Side Validation
Unanswered
Jerry posted this in #help-forum
![Avatar](https://cdn.discordapp.com/avatars/724150128122003477/85b0e17c15e261dad6f045c0362cbabb.webp?size=256)
JerryOP
I an currently following the [Chapter 14 - Server Side Validation](https://nextjs.org/learn/dashboard-app/improving-accessibility#server-side-validation)
I am replicating the same server action functionality i.e.
But when I added the
I am not sure what I did wrong as I directly referenced the tutorial syntax.
For time being I have added the union with
Is this something,
For full code - [NextJS-Blog](https://github.com/nigupta29/nextjs-blog)
I am replicating the same server action functionality i.e.
createInvoice
for handling the errors in the form in my blog app to createBlog
action.But when I added the
useFormState
in the form component, the below error is coming.Type 'CreateFormState | undefined' is not assignable to type 'CreateFormState'.
I am not sure what I did wrong as I directly referenced the tutorial syntax.
For time being I have added the union with
undefined
in CreateFormState
to remove the error.Is this something,
useFormState
is inferencing this type?For full code - [NextJS-Blog](https://github.com/nigupta29/nextjs-blog)
![Image](https://cdn.discordapp.com/attachments/1213444314869534750/1213444315452411914/image.png?ex=65f57f15&is=65e30a15&hm=52bb5f1f35fadb360b3c4572818d761cb229d4beae98e5b670507f315a5f56fd&)
![Image](https://cdn.discordapp.com/attachments/1213444314869534750/1213444315766857778/image.png?ex=65f57f15&is=65e30a15&hm=cd7589864d9dde97c7a83c0f3e9af05aff99c252b71c89e583294f0099534888&)