From the course: MERN Essential Training

Unlock this course with a free trial

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

Create the single item component

Create the single item component

From the course: MERN Essential Training

Create the single item component

- [Instructor] Now let's add the code to the PlayerSingle. So, the first thing we're going to do, we're going to make sure that we pass the currentPlayer state to the PlayerSingle. So as you can see in the constructor, we have an object that's called currentPlayer. And as we click on the players, we're going to pass who is this player to the currentPlayer and then pass this down to the PlayerSingle. So let's go ahead and make sure that we are passing this prop. So, we're going to do player and we're going to pass this.state/currentPlayer like so. Make sure you do dot and not forward slash. Okay, we're going to save this and then we're going to close this guy here, close the App.jsx. And now, we're going to go in the PlayerSingle and do a lot of code here. All right, so let's go and open PlayerSingle. I'm going to close my explorer and I'm going to start working on this specific Player Single. So, I'm going to remove the title here and I'm going to start with a className of row. And…

Contents