From the course: Building Modern Projects with React

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Creating a styled-component

Creating a styled-component

From the course: Building Modern Projects with React

Start my 1-month free trial

Creating a styled-component

- [Instructor] Now that we know what Styled Components are and some of the situations where they can help us, let's install the Styled Components package and add our first Styled Component to our app. So, the first thing we're going to do is install Styled Components into our project. So, let's open up a terminal inside our project directory. And we're going to run npm install styled-components. And once we've done that, we're free to use Styled Components in our project. So, let's start off by doing a little styling on our to-do list. So, let's open up our to-do list component, and at the top, we're going to say import styled from 'styled-components'. And let's delete this unused import here, since we won't need it anymore. And then down here, right above where we define our to-do list component, we're going to create our first Styled Component. And here's how we create a Styled Component. We're just going to create a…

Contents