← TypeScript learning pathTypeScript · Module 10 of 10
TypeScript in real projects
Use TypeScript with React, Node and runtime validation.
📖 Key ideas
- React: type props with interfaces: function Card({ title }: CardProps).
- Node/Express: type req and res; use tsx or ts-node to run.
- Validate external data at runtime with zod and infer types from schemas.
- Turn on strict mode and fix errors, don't silence them with any.
- Migrate gradually: allowJs, then convert file by file.
💡 Real-life example: zod is a security guard at the door checking IDs at runtime, since TypeScript only checks the guest list on paper.
zodRuntime schema validation library
z.inferDerives a TS type from a zod schema
tsxRuns TypeScript files directly
allowJsLets JS and TS live together