Hello Devs, 

In this tutorial, we will learn React Axios Delete Request Example

Axios is a npm package and the provide to make http request from your application. in this example we will use "jsonplaceholder" api to delete data using axios package.

Follow this step by step guide below. 

Example Code:

import React from 'react';
import axios from 'axios';
export default class PostList extends React.Component {
  state = {
    posts: []
  componentDidMount() {
      .then(res => {
        const posts = res.data;
        this.setState({ posts });
  deleteRow(id, e){
      .then(res => {
        const posts = this.state.posts.filter(item => item.id !== id);
        this.setState({ posts });
  render() {
    return (
        <h1>React Axios Delete Request Example - rathorji.in</h1>
        <table className="table table-bordered">
              {this.state.posts.map((post) => (
                    <button className="btn btn-danger" onClick={(e) => this.deleteRow(post.id, e)}>Delete</button>

May this example help you.