Introduction to the

Why ts

When you’re reading someone else’s JS code and following the path to find the definition of a method you’re using.

When you use a code base, you know what to do, but it’s not clear and lacks hints.

When you interact with the interface on the back end, you often forget what properties it has and need to go back and forth to the document.

Ts can help you solve these problems. In TS, you can easily find method definitions by using command/ CTRL + left mouse button.

The ability to have friendly prompts when you use the code base acts as documentation.

When you interact with the back-end interface, if you can correctly pass data into/out of the data format definition of the interface, you will be prompted to use the corresponding process, you will not have to go back and forth to the document, and you will not be afraid of missing or miswriting properties.

And ts does not need to load additional Babel, polyfill itself can directly compile into the es specified version of the code, including exported code can support umD/CMD/ESModule and other ways, also provides great convenience.

conceived

This article is about building projects in typescript to see what problems you encounter and how to solve them.

Combined with the actual scene, describe, or give the relevant information links, the main idea of implementation as a supplement.

Since you are not taught to write by hand, reading requires a basic understanding of the corresponding tools.

directory

  • Hands type
  • typescript
  • React Little gestures
  • React state management