Skip to content

Getting Started with TypeScript in React

TypeScript can be used with React.js, just like JavaScript can and is. As TS is a superset of JavaScript, there is, depending on compiler options, no need to actually use TypeScript features. In the following, we’ll have a look at unique parts of TSX and how to get started.

There are two ways to get started:

Terminal window
yarn create react-app my-app --template typescript

or:

yarn create react-app my-app --template typescript

For Next.js, there are also two ways of getting started:

Terminal window
npx create-next-app@latest --ts

or:

Terminal window
yarn create react-app my-app --template typescript