Loading video...

Problem

Component Files

Fix the extension of the "App.js" file in order to make it possible to add types to that file.

Transcript

Right now we're gonna move on to working with TypeScript and react. We're gonna work our way from plain JavaScript, which we've been using so far to TypeScript.

And we're gonna see how to add incrementally types to our React application.

And the first thing to notice when we're working with TypeScript and React is that we need to use a different file extension.

Up until this point, we've just used the.js extension right here, we have a simple app component that's displaying a div with the text Hello, TypeScript. And this works entirely fine.

And in many cases, we can even combine this with a TypeScript react application.

In many cases, you don't have to set this up on your own.

The one that I have here was created with the framework create react app using the TypeScript template.

So be aware that there's some extra configuration to work with TypeScript that we'll cover in just a bit.

But this is not something that you usually have to set up on your own. Everything is identical to what we've worked with so far. And at the moment, we are rendering our app component.

But to be able to add types to it, we need to change the extension of our file that we want to add types to so i want you to do that with the app component.

See if you can figure out what extension to add in order to enable TypeScript when working with app.js.