I have a delete button that have I set some static datas. In it I passed some ids. Matched ids should be deleted when you click the button. My problem is that I can't delete any item that matched its id.
Codesandbox is here CLICK HERE
case appConstants.DELETE_IMAGE_SUCCESS:
return {
...state,
products: state.products.map((product) => ({
...product,
productImages: (product.productImages ?? []).filter(
({ id }) => !id.includes(action.payload)
)
}))
};