It allows for type checking before runtime, improves the productivity of developing complex applications, and reduces type errors drastically before production.
In this article, as a beginner familiar with React JS, you will learn how to create your first typescript project using the Visual Studio code editor or any other editor you choose.
Vscode editor Installed (or any other preferable editor).
Node installed on your device.
Basic understanding of ReactJs.
Why I chose Typescript
"Hi Aisha, we will be using Typescript in our next project."
What is Typescript?
Setting up a new Typescript project using react
Steps to set up a Typescript project
Open your editor and navigate to the terminal.
Cd into the desktop and make a new directory on the desktop and name it Typescript-project-tutorial.
Cd into the new directory created on the desktop.
Create a new Typescript project using react by adding
After Installation, you get the folder structure below, including a Typescript config file.
Now that you've successfully started a Typescript project with the Reactjs library, you can remove unnecessary files and rearrange your project directories anyhow you want it.
In this article, you learned what Typescript is and how to create a Typescript project using the ReactJs library. For further understanding of Typescript, you can check out the following resources.