how do i delete the array element in a native function component?

The Mutability causes this.

Mutable is a type of variable that can be changed. In JavaScript, only objects and arrays are mutable, not primitive values. Source

You need to change it to:

await setBuques(await buques.filter((el, i) => (i === index)))
console.log(buques)

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top