Next.js Discord

Discord Forum

Help in Server-Side Validation

Jerry posted this in #help-forum
Open in Discord
I an currently following the [Chapter 14 - Server Side Validation](

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](

0 Replies