Answers for "how to delete an object from array in reactjs"

0

how to delete an object from array in reactjs

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

    }
Posted by: Guest on July-05-2021

Code answers related to "how to delete an object from array in reactjs"

Code answers related to "Javascript"

Browse Popular Code Answers by Language