In this video, Emmanuel Henri demonstrates how to work with basic types— such as string, number, Boolean, and arrays—and their syntax.
- The main function of TypeScript is to instill Inner Code…best practices such as typing spections.…We define what our application expects…and validate it against the data we get.…For example, if our component expects a value first name…and we expect this value to be of a string,…TypeScript will check this is the case…and then warn us if it isn't.…So let's explore the basic types of available with…TypeScript with a few examples.…The first thing I'm going to do is remove the lines…from 14 to 21, and then what we'll do is edit the code…on line 12 here. So what we're going to do is erase…what's in here first, and then I'm going to say "The value"…and then we're going to specify something once…we created that value "is of" and then insert "type of"…and then we'll insert the value "type", like so.…
And then let's go ahead and create just below the renders…so we turn on line 6 and let's create our first value.…So what we're going to do is create what "let first value"…and this is how you define a type for your variable.…
- Basic and complex types
- Functional/stateless components
- Class/stateful components
- Interfaces with React and TypeScript
- Implementing higher-order components