Using plain CSS
We will start this section by setting up a React and TypeScript project with the alert component from Chapter 3, Setting Up React and TypeScript. Next, we will add the alert component from Chapter 3 and style it using plain CSS. Finally, we will look at one of the challenges with plain CSS and discover how we could mitigate it.
Creating the project
The project we will be using is the one we completed at the end of Chapter 3. This can be found at the following location: https://github.com/PacktPublishing/Learn-React-with-TypeScript-2nd-Edition/tree/main/Chapter3/Section2-Creating-a-project-with-Create-React-App/myapp. To copy this locally, carry out the following steps:
- Open Visual Studio Code in a folder of your choice.
- Run the following command in the terminal to clone the GitHub repository for the book:
git clone https://github.com/PacktPublishing/Learn-React-with-TypeScript-2nd-Edition.git
- Reopen Visual Studio Code in the
Learn-React-with-TypeScript...