score:0

Accepted answer

for updating state you must use setstate() function , please try this :

 componentdidmount() {
        const self = this;
        self.getinvoicedata()
            .then((response) => {


                this.setstate({
                    invoices : response
                 });
            })
            .catch((err) => {
                console.error(err);
            })
    }

score:0

the trick was not to manipulate state in the parent directly, but instead to use the setstate({}) function.


Related Query

More Query from same tag