Forms 0 exercises

Wrapping Up the Forms Tutorial

By now, you should be comfortable with not only rendering forms in React but also utilizing React Hook Form for data management.

You've also learnt how to use Zod for data validation and four distinct ways to send data to the server:

  • Sending a JSON payload to an API endpoint
  • Sending a form dat
Loading lesson


00:00 So now you know not just how to render forms, but also how to use React Hook Form to manage data, Zod to validate data, and four, yes, four different ways of sending data to the server. A JSON payload to an API endpoint, a form data payload also to an API endpoint, a data

00:20 object to a server action, and finally a form data object to another server action. Of course, you get to pick which is the right methodology for your application. What I find even more impressive is how little TypeScript we used. There's a little typing on the properties of the components, but the heavy lifting of

00:35 TypeScript was done primarily by that z.infer that generated the TypeScript type from the Zod schema. In fact, the Zod schema has no TypeScript types in it at all. So cool. Enjoy, and start building out your next JS forms today.