I am using async and await for getting response from an api but when I using it with react type script it keeps
TS2339: Property 'email' does not exist on type 'AxiosResponse<any, any>'.
I am following a course but it seems he work in older version is there any way to achieve that
here is my function for submit form
const submitRegister = async (e: SyntheticEvent)=>{
e.preventDefault();
const { email:email } = await axios.post('http://lovalhost/8000');
}
any help will be appreciated
dataproperty IIRC, so it would look likeconst { data: { email } } = ...