This project demonstrates how to implement dynamic forms in React using TypeScript, Zod, and React Hook Form. The forms adapt their validation logic based on user input, making it a flexible and powerful tool for handling complex form scenarios.
- React with TypeScript for strong type safety
- Vite 5 for fast development and build setup
- Zod for schema validation and discriminated unions
- React Hook Form for managing form state and validation
- Dynamic form inputs like radio button groups and checkboxes
- Extensible design to support any dynamic form scenario
- Node.js version 18 or higher
- Clone the repository:
git clone https://github.com/your-username/your-repo-name.git
- Navigate to the project directory:
cd your-repo-name
- Install dependencies:
npm install
- Start the development server:
npm run dev
To build the project for production:
npm run build
This project is part of a tutorial available on my YouTube channel, where I walk through the entire process of building dynamic forms with Zod and React Hook Form. Be sure to check it out!