From the course: React: Working with APIs
Unlock the full course today
Join today to access over 24,700 courses taught by industry experts.
Create a new component for side news - React.js Tutorial
From the course: React: Working with APIs
Create a new component for side news
- [Instructor] Now that we have a spot for a side news let's create the proper components to handle these news. Let's get through it. So what I'm going to do now is basically leave those open just in case there are errors or something that I need to work on once we tested it at all. But what I'm going to do now is create the component, SingleSide. So let's go ahead and do that by creating a brand new component here that I'm going to call SingleSide.js. And in here I'm going to import React from react. Then we're going to create a functional component that I'm going do SingleSide like so. And inside of that component as an argument, I'm going to pass item, which is a prop that we're going to leverage. And then we're going to change a bit of our approach. Remember that I said that the component here could be exactly the same as new single but I want to do something different here to make it shorter and different approach…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.