Hi, I want to remove row based on index but while I am removing the row and getting splice is not a function. Removed row is shown in the consol

Hi, I want to remove row based on index but while I am removing the row and getting splice is not a function. Removed row is shown in the console but not updating row. Could you please help me anyone and pasting the code.

const handleRemoveXAPIValues = (index) => {
  setAnchorEl(null);
  console.log(“XAPIStatement”, xapiStatment);
  let removeSelectedRow = […removeXAPiRow];
  // console.log(“removeSelectedRow”, removeSelectedRow);
  // removeSelectedRow.splice(index, 1);
  // setRemoveXAPIRow(removeSelectedRow);
  removeSelectedRow[0].object.map((item) => {
    let xapiValues = item;
    console.log(“xapiValues”, xapiValues)
    xapiValues.splice(index, 1);
    console.log(“xapiValuesTwo”, xapiValues);
    setRemoveXAPIRow(xapiValues);
  })
  //handleRemove(index);
}

I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').