background icons
background icons 2

Video Belajar

Tonton dan pelajari berbagai topik menarik melalui video pembelajaran eksklusif dari Channel Dave Gray.

Dave Gray

9149

Why You Should Use TypeScript Generics with react-hook-form

Web Dev Roadmap for Beginners (Free!): https://bit.ly/DaveGrayWebDevRoadmap

Learn Why You Should Use TypeScript Generics with react-hook-form. In this short video, we'll answer a viewer question by refactoring a custom input in a react-hook-form to use a TypeScript generic.

💖 Support me on Patreon ➜ https://patreon.com/davegray

⭐ Become a full-stack web dev with Zero To Mastery Courses:
- Complete Next.js Developer: https://bit.ly/CompNextJSDev
- Advanced React: https://bit.ly/AdvReactDev
- Junior to Senior Dev Roadmap: https://bit.ly/WebDevRoadmap-JrtoSr

🚩 Subscribe ➜ https://bit.ly/3nGHmNn

📬 Course Updates ➜ https://courses.davegray.codes/

❓ Questions - Please post them to my Discord ➜ https://discord.gg/neKghyefqh

☕ Buy Me A Coffee ➜ https://www.buymeacoffee.com/davegray

🔗 Starter Source Code Example: https://github.com/gitdagray/nextjs-form-modal

🔗 My Next.js Videos: https://www.youtube.com/playlist?list=PL0Zuz27SZ-6Pk-QJIdGd1tGZEzy9RTgtj

👇 Follow Me On Social Media:
GitHub: https://github.com/gitdagray
Twitter: https://twitter.com/yesdavidgray
LinkedIn: https://www.linkedin.com/in/davidagray/

Why You Should Use TypeScript Generics with react-hook-form

(00:00) Viewer Question on TS Validation
(01:43) Add a TS Generic to the React component
(04:45) Pass the Schema type to the Input
(07:02) Wrap up

📚 Tutorial References:
🔗 shadcn/ui: https://ui.shadcn.com/
🔗 shadcn/ui Dialog component: https://ui.shadcn.com/docs/components/dialog
🔗 react-hook-form: https://react-hook-form.com/
🔗 Zod: https://zod.dev/
🔗 zod-fetch: https://www.npmjs.com/package/zod-fetch
🔗 @hookform/resolvers: https://www.npmjs.com/package/@hookform/resolvers

Was this tutorial about how to use TypeScript Generics with react-hook-form custom inputs helpful? If so, please share. Let me know your thoughts in the comments.

#typescript #generics #react