Dev Kapoor · Staff frontend engineer
TypeScript for React Apps
Add TypeScript to React the practical way: props, events, generics for hooks, and typed fetch layers so refactors stop breaking silently.
What you'll learn
- Type props, events, and children correctly
- Model async UI states with discriminated unions
- Share types between client and API responses
- Migrate a JS React file to TypeScript safely
Skills
- TypeScript
- React
- Generics
- API types
Curriculum
TS + React basics4 lessons
- tsconfig for a Vite React app · Free previewStrictness that helps without blocking you.10 min
- Typing props and event handlers · Free previewFC patterns you can delete later.14 min
- useState and useRef with typesInfer when you can; annotate when you must.13 min
- Context and providersTyped context without any.12 min
Real app patterns4 lessons
- Union states for loading/error/dataExhaustive UI that cannot forget a branch.15 min
- Typing fetch and Zod-style parsingValidate at the boundary; trust inside.16 min
- Generic custom hooksReusable hooks that stay type-safe.14 min
- Capstone: typed dashboard widgetsCards, charts data, and filters with full types.20 min