How to Install and Set Up React with Vite and TypeScript (Step by Step)

Thirdy Gayares
Author
In this article, I will show you how to set up a React project using Vite and TypeScript step by step. This guide is perfect for beginners who want to start using React with TypeScript in a fast and efficient way. By the end, you will have a working project that is ready for development.
Important Note
Before starting, make sure you have Node.js installed on your machine. Vite requires Node.js to run. You can download and install it from the official website: https://nodejs.org/.
1. Create a Vite + React + TypeScript Project
Run the following command in your terminal:
npm create vite@latest my-new-app --template react-ts

Choose React:

Choose Typescript:

Then, go into the project folder:
cd my-new-app

2. Install Dependencies
Run:
npm install

3. View Source Code on your favorite IDE

4: Run your code
Run:
npm run dev

Your React + Vite + TypeScript project is now ready!
