bookworm-react
bookworm-react copied to clipboard
[LoginPage] Cannot read property 'push' of undefined
Unhandled Rejection (TypeError): Cannot read property 'push' of undefined at line submit=(data)=>this.props.login(data).then(()=>this.props.histroy.push("/"))
Please Check.
4 month later: May be a typo? submit=(data)=>this.props.login(data).then(()=>this.props.histroy.push("/"))
submit=(data)=>this.props.login(data).then(()=>this.props.history.push("/"))
this still is not working for me. history
is an undefined prop in components.
so in any component that I needed to route by function, I had to export that component withRouter