- Learn React with TypeScript 3
- Carl Rippon
- 275字
- 2021-06-10 19:16:40
Summary
At the start of this chapter, there was a section on why we would use TypeScript to build a frontend. We now have first-hand experience of TypeScript catching errors early and giving us productivity features such as IntelliSense. We learned that TypeScript is just an extension of JavaScript. So, we get to use all of the features in JavaScript plus additional stuff from TypeScript. One of these additional things is type annotations, which help the compiler spot errors and light up features such as code navigation in our code editor.
We haven't covered everything about types yet, but we have enough knowledge to build fairly complex TypeScript programs now. Classes, in particular, allow us to model complex real-world objects nicely. We learned about modules and how they keep us out of that dangerous global scope. Modules allow us to structure code nicely and make it reusable. We can even use these if we need to support IE, because of that magical TypeScript compiler.
We learned a fair bit about the TypeScript compiler and how it can work well in different use cases because it is very configurable. This is going to be important for when we start to use TypeScript with React later in the book.
TSLint and Prettier were the icings on the cake. It's down to us and our team to debate and decide the TSLint rules we should go with. The benefit of both these tools is that they force consistency across our code base, which makes it more readable.
Now that we understand the basics of TypeScript, we'll dive into the new features that have been added in TypeScript 3.
- 手機安全和可信應用開發指南:TrustZone與OP-TEE技術詳解
- Mastering RabbitMQ
- Python從入門到精通(精粹版)
- Python GUI Programming Cookbook
- Python高效開發實戰:Django、Tornado、Flask、Twisted(第2版)
- JavaScript動態網頁開發詳解
- Modular Programming in Java 9
- Python完全自學教程
- 西門子S7-200 SMART PLC編程從入門到實踐
- 學習OpenCV 4:基于Python的算法實戰
- Node.js開發指南
- Java 從入門到項目實踐(超值版)
- 分布式數據庫HBase案例教程
- 軟硬件綜合系統軟件需求建模及可靠性綜合試驗、分析、評價技術
- AngularJS UI Development