← TypeScript learning path
TypeScript · Module 10 of 10

TypeScript in real projects

Use TypeScript with React, Node and runtime validation.

📖 Key ideas

  1. React: type props with interfaces: function Card({ title }: CardProps).
  2. Node/Express: type req and res; use tsx or ts-node to run.
  3. Validate external data at runtime with zod and infer types from schemas.
  4. Turn on strict mode and fix errors, don't silence them with any.
  5. 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