An Interest In:
Web News this Week
- March 3, 2024
- March 2, 2024
- March 1, 2024
- February 29, 2024
- February 28, 2024
- February 27, 2024
- February 26, 2024
February 25, 2022 06:57 am GMT
Original Link: https://dev.to/programmershahjalal/typescript-with-react-3kbp
Typescript with React
What is Typescript?
Typescript is a superset of the JavaScript language. The purpose is to give JavaScript a flavor of strongly typed language so that our code errors are easily detected and we are protected from many unwanted behaviors in the application. Typescript cannot be written in a browser like JavaScript.
Globally typescript installation:yarn global add typescript
ornpm install typescript -g
Installation typescript in local project:yarn add typescript
ornpm install typescript
Initialization typescript in project
tsc --init
How to compile a specific file?tsc app.ts
How to compile a specific file with watch mood?tsc app.ts -w
Compilation of all files and also with watch mood:tsc
tsc -w
Basic data types:
- Any
- number
- string
- boolean
- object
- Array
- Tuple
- Enum
- undefined
- null, void
- never
- unknown
Original Link: https://dev.to/programmershahjalal/typescript-with-react-3kbp
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To