score:0

make sure your the object you pass to the logoutuser function is not undefined and the history parameter is received in the right way. you are trying to invoke the push method on the history object, but in this case it tells you that the function can not be found because history is undefined. hope this helps.

score:1

you should use

withrouter(connect(...)(mycomponent))

and not

connect(...)(withrouter(mycomponent))

here is the documentation

i think this.props.history is undefined in your example because of this.


Related Query

More Query from same tag