Skip to content
WebDev Path
Back

Week 14: TypeScript for React developers

Next video

Free lesson by Fireship on YouTube

About this lesson

Module:
TypeScript and Next.js
Time:
about 10 hours
Video:
2 min

Catch bugs before they reach users by adding types to your code.

By the end of this week you can

  • Type variables, functions and objects
  • Use unions and generics basics
  • Type React props and API data

Learn

  • Basic types and inference
  • Interfaces and type aliases
  • Unions, narrowing and generics
  • Typing props, state and fetch results

Read or watch

Practice

  1. Convert Project 3 to TypeScript
  2. Remove every any

Build

Project 3 in strict TypeScript with zero type errors.

Check your understanding

Score 4 out of 5 to complete this week.

  1. 1. What does TypeScript add to JavaScript?
  2. 2. Which type allows only the strings "draft" or "published"?
  3. 3. Why avoid the any type?
  4. 4. How do you type a React component's props?
  5. 5. What does the ? in { name?: string } mean?
0 of 5 answered