Web Dev Roadmap for Beginners (Free!): 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 ➜ / davegray
⭐ Become a full-stack web dev with Zero To Mastery Courses:
- Complete Next.js Developer: bit.ly/CompNextJSDev
- Advanced React: bit.ly/AdvReactDev
- Junior to Senior Dev Roadmap: bit.ly/WebDevRoadmap-JrtoSr
🚩 Subscribe ➜ bit.ly/3nGHmNn
📬 Course Updates ➜ courses.davegray.codes/
❓ Questions - Please post them to my Discord ➜ / discord
☕ Buy Me A Coffee ➜ www.buymeacoffee.com/davegray
🔗 Starter Source Code Example: github.com/gitdagray/nextjs-f...
🔗 My Next.js Videos: • Next.js Tutorials for ...
👇 Follow Me On Social Media:
GitHub: github.com/gitdagray
Twitter: / yesdavidgray
LinkedIn: / 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: ui.shadcn.com/
🔗 shadcn/ui Dialog component: ui.shadcn.com/docs/components...
🔗 react-hook-form: react-hook-form.com/
🔗 Zod: zod.dev/
🔗 zod-fetch: www.npmjs.com/package/zod-fetch
🔗 @hookform/resolvers: www.npmjs.com/package/@hookfo...
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
21 июл 2024