2

Introducing TypeScript

In this chapter, we will start by understanding what TypeScript is and how it provides a much richer type system on top of JavaScript. We will learn about the basic types in TypeScript, such as numbers and strings, and then learn how to create our own types to represent objects and arrays using different TypeScript features. Finally, we will finish the chapter by understanding the TypeScript compiler and its key options in a React app.

By the end of the chapter, you’ll be ready to learn how to use TypeScript to build frontends with React.

In this chapter, we’ll cover the following topics:

  • Understanding the benefits of TypeScript
  • Understanding JavaScript types
  • Using basic TypeScript types
  • Creating TypeScript types

Get Learn React with TypeScript - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.