Below method isn't working. I also tried using useHistory but how to pass props using useHistory , Redirect method also not working
For example
Inside Functional Component{
instance.get(url).catch((error)=>{
if(error.response){
if(error.response.status===404){
<ErrorComponent err={error.response.status}/>
console.log("Page Not Found");
}
if(error.response.status===400){
<ErrorComponent err={error.response.status}/>
console.log("Bad Request")
}
}
}
}