score:0

if the returned data is intended to be used locally in this component, then what you pass into usestate should match the response you are receiving from the server.

so if for instance your server returns a costomermodel object, you should initiate your usestate with an object -

const [ customer, setcustomer ] = usestate({})
try{
    const response = await axios.get<customermodel>(globals.urls.customerdetails)
    ...
    setcustomer(response);
    ...
}

Related Query

More Query from same tag