From the course: Building Modern Projects with React

Unlock the full course today

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

Creating the newTodoForm component

Creating the newTodoForm component

From the course: Building Modern Projects with React

Start my 1-month free trial

Creating the newTodoForm component

- Okay, so far we have our TodoList, and our TodoListItem components. The next and final component that we're going to add is the new TodoForm component. And this is a component that our users will be able to use to create new Todo's. So it'll have a text input, as well as a button. So first let's create our new files. We'll say NewTodoForm.js, and NewTodoForm.css. And it's going to be very similar to our other components where we say import, react, from react. And then we're going to define our component, const NewTodoForm equals. And for the time being, this component isn't going to take any props. Although it'll definitely get some later on in the course. And now for this NewTodoForm component, we're going to have a div with the class name new-todo-form. And it's going to have an input. We'll say type equals text. And we'll add more to this later on, but for now, this is all we need. And we're going to have…

Contents