From the course: Building Modern Projects with React

Unlock this course with a free trial

Join today to access over 24,400 courses taught by industry experts.

Creating the TodoListItem component

Creating the TodoListItem component - React.js Tutorial

From the course: Building Modern Projects with React

Creating the TodoListItem component

- [Instructor] All right, so now that we've created our TodoList component, let's create the component that's going to be used for each of the todo items. So this is going to be called TodoListItem.jsx. And here's what it's going to look like. We'll start off by saying export default function and we'll call this TodoListItem. And this is going to take a few props. The first is going to be the todo, right? The specific todo item that we're displaying. And then we're going to have two function props for when the complete button is clicked, right? There's going to be a button that allows you to mark it as completed and there's going to be another one that allows you to delete the todo so we're going to have two functions for when either of those buttons are clicked, we'll say onCompletedClicked, and onDeleteClicked. Cool. So now that we have that, here's what this component's going to look like. We'll start off by just saying return. And this is all going to be inside a div, which we'll…

Contents