I've got this function that needs to delete an item thats clicked from the array. Im sure its a simple fix but its not deleting it from the array. I think its something to do with how Im executing the function in the button? IM not entirely sure. error: TypeError: e.findIndex is not a function
const deleteClaim = (claim,value) => {
const index = claim.findIndex(element => element === value); // 1
const result = claim.splice(index, 1);
return result
}
the button is
<button onClick={(e) => deleteClaim(claim, e.target.value)} >X </button>