I build my Apps and learn ReactJS
My code error until now, i try to search on internet and forums but can't fix. Here my code :
logout(){
localStorage.removeItem("token");
localStorage.clear();
if(localStorage.getItem('token') === null){
this.props.history.push('/login')
}
}
Error : TypeError: Cannot read property 'push' of undefined
Please Help Me