Skip to content

Developing Work Skills · Career & Development

TypeScript for Clearer Code

Type a learning-goal feature and validate the data it receives.

Level
Intermediate
Estimated study
About 10 hours
Lessons
9 lessons in 3 modules
Format
Online, self-paced

Monthly: $0 today with a card, then $34 on day 8 unless you cancel before then. After the trial, 30 days' notice applies. Active on-campus students have academy access included. Check your existing student account before buying another subscription.

About this course

For learners who finished Build Applications with React. In about 10 hours you will add TypeScript to your goal tracker, model data with object types and unions, and validate data from outside the app at runtime.

What you will be able to do

  • Define types for application data and component inputs.
  • Use unions and narrowing to model different states.
  • Explain why external data still needs runtime validation.

Course outline

Module 1: Describe your data

3 lessons · 3 h

Practice annotations, inference, object types and function signatures.

  1. Describe values and understand inference1 h
  2. Define goal records and optional information1 h
  3. Write function contracts that expose failure1 h

Module 2: Represent different states

3 lessons · 3 h

Use unions, narrowing and a small reusable generic.

  1. Represent loading and result states with a union1 h
  2. Narrow unknown values before using them1 h
  3. Write a generic that preserves useful information1 h

Module 3: Add TypeScript to your React tracker

3 lessons · 4 h

Type the React goal tracker's components and validate data loaded from storage or a file.

  1. Type a React feature and its input events1 h 30 min
  2. Parse external goal arrays into a trusted shape1 h
  3. Deliver a typed feature with runtime evidence1 h 30 min
Get helpStart 7-day trial