handleDelete = e => {
const id = +e.currentTarget.dataset.id;
this.setState(({ data }) => ({
data: data.filter(n => n.id !== id),
}));
}
const CardList = ({ cards, handleDelete }) => (
<div className="cards__list">
{cards.map(n => <CardInfo {...n} handleDelete={handleDelete} />)}
</div>
);
<CloseOutlined onClick={props.handleDelete} data-id={props.id} />