I am trying to delete an item in a nested state but I have no idea how to implement that.
data structure
{
property: {
"_id" : "52",
"name" : "random",
"options" : ["item1", "item2", "item3"]
}
}
to delete a property, I am just making a comparison like this and it is working
property: state.property.filter(data => data._id !== action.propertyId),
but the problem is when I want to delete an item of options array, how can I delete an item and compare the values
.filterwhich is method of array. And yourpropertyis object..filtercan only be used with array