Tips

This lesson details six tips that will help you use TypeScript alongside React to build your apps.

Hover to discover the type of native browser elements and functions #

TypeScript types do exist for native browser elements like span, div, and input. Types already exist for native browser functions like fetch as well. But what are the types of these elements and functions? Well, if we are using Visual Studio Code, then we can hover over where the item is referenced, and a tooltip will show us the type information!

widget

Use strict mode #

We’ll get the most benefit out of TypeScript if strict mode is on. It is particularly useful in helping us avoid the any type and null ...