Fixing “Property ‘currentTarget’ does not exist on type ‘AxiosProgressEvent’”
Let’s say you have an axios onDownloadProgress function that looks like this:
onDownloadProgress: (axiosProgressEvent: AxiosProgressEvent) => {
const response = axiosProgressEvent.currentTarget.response
}And you’d like to upgrade your axios version. If you’re upgrading, then currentTarget
won’t exist on the event directly anymore, rather you have to access it via event.event:
onDownloadProgress: (axiosProgressEvent: AxiosProgressEvent) => {
const response = axiosProgressEvent.event.currentTarget.response
}And this is how you can fix Property currentTarget does not exist on type AxiosProgressEvent!