Let's look at App.tsx, which has been created for us. This is an example of a class component. We're going to create our own class component now. Follow these steps:
- Create a file called Confirm.tsx in the src folder, and enter the following into it:
import * as React from "react";class Confirm extends React.Component { }export default Confirm;
We learned all about classes in Chapter 1, TypeScript Basics. Here we are creating a class that extends the standard Component class from React. Note that we've imported React at the top of our file, and also that we are exporting our class component using a default export at the bottom of our file.
- Let's start to implement our Confirm class component now, by creating ...