From the course: React.js: Building an Interface

Unlock the full course today

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

Deleting records

Deleting records - React.js Tutorial

From the course: React.js: Building an Interface

Start my 1-month free trial

Deleting records

- [Instructor] Let's go ahead and add the functionality to delete these items. So in order to do that, I'm going to need to modify this appointment info and add a method that takes care of that. So right here, I'm going to say, whenever somebody clicks on this item then I'm going to execute an expression here. This is going to create an arrow function that calls this new method that I'm going to create called onDeleteAppointment and it's going to pass along the appointment ID. So sometimes you create things that live within the different components. So for example, when we did the toggling, the parent component didn't need to know about toggling something on and off inside a component but sometimes you do want to communicate with the parent component. In this case, we're going to be changing the data itself. So the parent component is going to manage all that data and we'll need to pass this along. Now that means that…

Contents