From the course: Build Modern Web Apps with React, Hooks, State Management, and APIs Using Vite or Next.js

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Benefits of Yup and Zod

Benefits of Yup and Zod

Hello and welcome to lesson number 4 of this course. In this lesson, we are going to understand validation using schema-based libraries and these libraries are YUP and the ZORT. Before we dive in how to use these schema-based validation libraries, we should first see that why we should actually use it. It means what benefits these libraries brings to the table. The first one is that for your application you are going to have multiple forms and so many screens in large scale applications. So writing down form element and creating forms for each of your page doesn't make sense. That way you are going to have a very bulky and not so readable code. So we need to put things centralized and have a declarative validation rules for our forms. So the forms can actually have the JSX only and we don't have to worry about writing down the validations inside our JSX elements. Using the schema-based validation libraries like Yelp and Zord, we can have a centralized form validation-based approach…

Contents