title: Error Argument is not assignable to parameter of type 'AxiosRequestConfig'
body: <p>I want to be able to delete items of a list fetched from MongoDB.</p>
  <p>Items of an array of the list are retrieved from MongoDB and displayed in React app (I use Typescript).</p>
  <p>Unfortunately, I get error <code>HERE I get error Argument of type '{ itemId: any; }' is not assignable to parameter of type 'AxiosRequestConfig'</code></p>
  <p>ExpensesListItem.tsx</p>
  <pre><code>import React from &quot;react&quot;;
  import { IconButton, ListItem, ListItemSecondaryAction, ListItemText } from &quot;@material-ui/core&quot;;
  import DeleteIcon from '@material-ui/icons/Delete';
  import { ExpenseAndAmountObject } from '../ExpenseAndAmountObject';
  import axios from 'axios';
  interface Props {
      expenseTitle: string;
      expenseAmount: string;
      currencySymbol: string;
      item: ExpenseAndAmountObject;
      expenseAndAmountList: Array&lt;ExpenseAndAmountObject&gt;;
      setExpenseAndAmountList: (value: Array&lt;ExpenseAndAmountObject&gt;) =&gt; void;
    }
  
  const ExpensesListItem: React.FC&lt;Props&gt; = (
      {
          expenseTitle,
          expenseAmount,
          currencySymbol,
          item,
          expenseAndAmountList,
          setExpenseAndAmountList
      }: Props) =&gt; {
  
          const DeleteListItem = (toBeDeletedItemId: any) =&gt; {
          setExpenseAndAmountList(expenseAndAmountList.filter(el =&gt; el._id !== toBeDeletedItemId));
  
          axios.delete('http://localhost:4000/app/expenseslist',{itemId:toBeDeletedItemId}) 
  //HERE I GET THE ERROR Argument of type '{ itemId: any; }' is not assignable to parameter of type 'AxiosRequestConfig'
          .catch(function (error) {
              console.log(error);
          });
      }
      return (
          &lt;&gt;
              &lt;ListItem className=&quot;list-item&quot;&gt;
                  &lt;ListItemText primary={expenseTitle} secondary={expenseAmount + currencySymbol} /&gt;
                  &lt;ListItemSecondaryAction&gt;
                      &lt;IconButton onClick={()=&gt;DeleteListItem(item._id)} edge=&quot;end&quot;&gt;
                          &lt;DeleteIcon className=&quot;delete-btn&quot; /&gt;
                      &lt;/IconButton&gt;
                  &lt;/ListItemSecondaryAction&gt;
              &lt;/ListItem&gt;
          &lt;/&gt;
        );
    }
    
  export default ExpensesListItem;
  </code></pre>
  <p>routes.js</p>
  <pre><code> router.delete('/expenseslist', (request, response) =&gt; {
      let itemId = request.body._id;
      ExpenseAndAmountTemplate.findByIdAndRemove(itemId, function(err){
          if(err){
              response.send(&quot;/Could not delete the item...&quot;);
          } else {
              response.send(&quot;/Expenses and amount item was deleted succesfully...&quot;);
          }
       });
   });
  </code></pre>
  <p>ExpenseAndAmountModel.js (This is the model used at router.delete)</p>
  <pre><code>const mongoose = require('mongoose');
  
  const ExpenseAndAmountTemplate = new mongoose.Schema({
      _id: {
          type:String,
          required:false
      },
      expenseTitle: {
          type:String,
          required:true
      },
      expenseAmount: {
          type:String,
          required:true
      }
  });
  
  module.exports = mongoose.model('ExpenseAndAmountData', ExpenseAndAmountTemplate);
  </code></pre>
  <p>Do you know how to solve it? Thanks!</p>