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.


you should use


and not


here is the documentation

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

Related Query

More Query from same tag