EN
React - create new TypeScript application
6
points
In this short article, we would like to show how in simple way create React TypeScript application from command line using npm
.
Quick solution (run the command):
npx create-react-app my-new-app --template typescript
Where: my-new-app
is the project name and directory that will be created.
Note: be sure the React is installed or install it with
npm install -g react
.
Application running
After application is created, should do the following steps to run the application:
1. Change working directory to the application directory:
cd my-new-app
2. Start the application using the command:
npm start
yarn
package manager
We can use yarn package manager, too:
yarn create react-app my-new-app --template typescript
cd my-new-app
yarn start