- add type check
- Suitable for large projects
- compile speed is slow
- Not all browsers support TypeScript(need to rely on loader)
Let’s take deno project as an example. Deno used to use a large percentage of TypeScript but then they keep decreasing the percentage of TypeScript to improve the speed.
Nowadays Deno only has 15% TypeScript.
Step 1: install some additional packages:
npm install --save typescript @types/node @types/react @types/react-dom @types/jest
Step 2: rename all .js file into .tsx
Step 3: modify tsconfig file(optional)
config file will be autogenerated after you install the libraries that I have mentioned before. For more information you can visit this page:
Don’t forget to like, if you find this article useful.