Removing array item and set state in React – functional version

The correct way is by using the array.filter method.

Check it here