bookworm-react icon indicating copy to clipboard operation
bookworm-react copied to clipboard

[LoginPage] Cannot read property 'push' of undefined

Open rusty795 opened this issue 6 years ago • 2 comments

Unhandled Rejection (TypeError): Cannot read property 'push' of undefined at line submit=(data)=>this.props.login(data).then(()=>this.props.histroy.push("/"))

Please Check.

rusty795 avatar Mar 27 '18 17:03 rusty795

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("/"))

deniercounter avatar Jul 13 '18 18:07 deniercounter

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

AmirHMousavi avatar Aug 31 '18 06:08 AmirHMousavi