Axios Keeps on making multiple requests in ionic react

Axios keeps on making multiple serve requests app ends up crashing

const componentDidMount=()=>{
    axios.get('http://192.168.1.23/App_Data/Inventory.php'
      ,{
        params:{
          getData:1,
        }
      })
    .then(function(response:any){
      if(response.data.length > 0){
        console.log(response);
        let results:any = response.data;
        setData(results); 
      }else{
        let results:string = "No Data Available";
        setData(results); 
      }
    })
    .catch(function(error){
       let results:string = "Server is Offline";
        setData(results); 
    });
    // .then(function(){

    // });
  }
  componentDidMount()

Had to encapsulate everything in useEffect.