From the course: Master React 19 and Next.js 16 with Hands-On Projects and Real-World Applications

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Styling React components

Styling React components

In this session, you are going to learn how to style React components. Let's create a components folder inside the src folder. Now let's create three files inside the components folder. These files will host the components we will populate and style later on. Let's populate the first file, google-component.jsx I added the basic structure of a functional component. You'll see I defined a function called google-component that takes no arguments and returns nothing yet. You'll notice it's just a pair of curly braces, indicating that the component doesn't yet return any JSX. Let's export it using this line, which makes it available for import in other parts of the application. This is a standard practice in React. Now let's move to the Apple component. Let's give it the same basic structure, mirroring the Google component. And let's do exactly the same thing to the Amazon component. Now we have three empty React components ready to be used in any part of our application. Back to the App…

Contents