Loading tutorials
register, handleSubmit, and Zod.5 min readuseForm in the previous chapter. Here you will learn what register returns, how to apply it to each kind of input, and which mistakes cau4 min readsubmit event, and async/await. You should also have used useForm and register. By the end you will know what handleSubmit does on each submit and which formState flags it updates.4 min readdefaultValues works in React Hook Form, how reset changes it, and the mistakes that follow from misunderstanding either. It assumes you know React function components and hooks, TypeScript generics, and the basics of register and handleSubmit. It also assumes you have5 min readzodResolver yet. That comes in a later chapter. Here the goal is narrower: write the rules for your data once, and get the TypeScript type5 min readuseForm, register, and handleSubmit basics from earlier chapters, and how z.object and z.infer work. By the end, you will know what zodResolver does on eac4 min readuseForm, register, handleSubmit, and zodResolver. Here you will read what the form knows about itself through formState, and turn validation failures into messages next to the righ4 min readmode and reValidateMode options of useForm. It assumes you can already build a form with register, handleSubmit, and zodResolver, and that you read errors from formState.errors. You should also be comfortable with React hooks and basic TypeScript generics.5 min readuseForm, register and handleSubmit, and that you have connected a Zod schema with zodResolver. It also assumes you can read basic TypeScript generics.4 min readuseForm, register, and handleSubmit. It also assumes you can connect a Zod schema with zodResolver and read z.infer. Here you will see why a schema can have two types, and how React Hook Form uses each one.4 min readuseForm, register, and handleSubmit, and that you can read a Zod object schema connected through zodResolver. You should also be comfortable with React keys and TypeScript generics.5 min readuseForm, register, and handleSubmit, and that you have connected a Zod schema with zodResolver. You also need to know the difference between a controlled and an uncontrolled input in React.3 min readuseForm, register, and handleSubmit, and that you have connected a Zod schema with zodResolver. It also assumes you are comfortable with async/await and fetch. Here you will send validated values to an API and display the errors the server4 min readuseForm, register, and zodResolver, and that you read field errors from formState.errors. You should also know basic HTML form elements and React hooks.5 min readuseForm, register, and zodResolver, and that you know how React decides when a component re-renders. It covers how to read a field's current value while the user types, and how to do that without re-rendering the whole form.4 min readuseForm and zodResolver, that you know z.infer, and that you have used setError after a failed request. It also assumes you can read a fetch call and a request handler that returns JSON.4 min readdescribe, it, expect) and async/await. The examples use Vitest, Testing Library, and user-event. Jest works the same way ap4 min read