learn-code.com
← all courses
TypeScriptIntermediate3 lessons · 60 min$49

TypeScript for React Devs

Go from guessing at types to shipping with confidence. Covers generics, discriminated unions, and the type errors you actually see in real components.

by Bill Hall

What you'll actually walk away with

Most TypeScript-for-React tutorials stop at FC<Props> and call it a day. This course goes in the opposite direction: we skip the trivia and spend time on the type problems you actually run into.

By the end, you'll be able to:

  • Write generic components that accept an items array and infer the item type from context
  • Use discriminated unions to make invalid state unrepresentable
  • Read and debug the gnarly Cannot assign to... errors from @types/react without googling
  • Type an async hook that handles loading / error / data states without as any

Prerequisites

You've shipped a React app. You've touched TypeScript enough to know what interface is but have never written a generic type parameter on purpose.

Structure

Three lessons, ~60 minutes each. Videos run at 1x comfortably.

§/ lessons

1 free preview
  1. 01

    Welcome & how this course works

    8 min · free preview

    free
  2. 02

    Generics, from scratch

    24 min

    ◎ locked
  3. 03

    Discriminated unions for async state

    28 min

    ◎ locked

// unlock this course

One-time purchase · $49

lifetime access · updates included