score:0

Accepted answer

you can use fetch insted of axios

async componentdidmount() {
   const res = await fetch(`api/info/gettablelist`)
   const data = await res.json();
   this.setstate({
      data
   })
}

or you can use like this.

async componentdidmount() {
    await fetch(
              `api/info/gettablelis`,
              {
                method: "get",
              }
            )
              .then(data => data.json())
              .then(data => {
                this.setstate({
                  data
                });
              }),
}

score:0

the problem here is axios will return the response object, you need to get the data from the response

componentdidmount() {
    axios.get('api/info/gettablelist ').then(({data=[]}) => {
        this.setstate({ data});
    })
}

i have used shorthand syntax you can use the normal syntax

componentdidmount() {
    axios.get('api/info/gettablelist ').then((res) => {
        this.setstate({ data : res.data});
    })
}

also please try logging the res like

componentdidmount() {
    axios.get('api/info/gettablelist ').then((res) => {
        console.log(res);
        this.setstate({ data : res.data});
    }).catch(console.error)
}

please share the entire console log


Related Query

More Query from same tag