import React, { useState } from "react"; import axios from "axios"; const API_URL = "http://localhost:5000/mastersdata"; const DeleteMaster = ({ master,onClose}) => { const [loader, setLoader] = useState(false); const handleDelete = () => { const index = mastersdata[master?.masterType]?.findIndex(item => String(item?.id) === String(master?.item?.id)); console.log(index) if (index !== -1) { mastersdata[master?.masterType].splice(index, 1); } onClose() }; return (
Are your sure , you want delete