onDeleteObject = (country) => { const newCountries = this.state.countries.filter(element => element.id !== country.id); this.setState({ countries: newCountries }); }