From the course: Building React and ASP.NET Core Applications

Unlock the full course today

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

Deleting data from React

Deleting data from React

From the course: Building React and ASP.NET Core Applications

Start my 1-month free trial

Deleting data from React

- [Instructor] The only feature left in our app is deleting data. So let us now go to Visual Code and implement this feature. Here, we are going to start by creating a new component, so inside source, components, trip. And here, create a new file, delete.jsx. And then in here, let us import the react, then component from react, and also since we are going to send an http get to get the details of the trip, and then http delete request to delete the trip, we need to import axios, as well, so let's write in here import axios from axios. Now in here, write export class, delete, which extends, then in here, we write the component base class. Let's create the constructor, so ctor, then double tap, then inside here, let's pass props, then in here, write super props. Let's create this state, so for the dual, just write this.state is equal to, we'll have a name, then we will have the description, then a date…

Contents