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.
Source: stackoverflow.com
Related Query
- Cannot read property '.then' of undefined when testing async action creators with redux and react
- React Redux Cannot read property 'dispatch' of undefined
- react / redux - cannot read property "yyy" of undefined
- Faced TypeError: Cannot read property 'counter' of undefined when using Redux in React
- Cannot read property 'map' of undefined - react , redux
- react TypeError: Cannot read property 'fulfilled' of undefined on Redux tool kit
- React Redux - Uncaught (in promise) TypeError: Cannot read property 'props' of undefined
- React Redux - TypeError: Cannot read property 'props' of undefined
- Avoid cannot read property 'map' of undefined in react redux
- TypeError: Cannot read property of undefined react redux
- React / Redux TypeError: Cannot read property 'Requests' of undefined in component
- TypeError: Cannot read property 'map' of undefined react redux when updating
- React Redux error Unhandled Rejection (TypeError): Cannot read property 'data' of undefined
- React redux Cannot read property 'firstName' of undefined
- React Redux Toolkit: TypeError: Cannot read property 'value' of undefined
- React Redux - Showing Dialog after posting data not working - Unhandled Rejection (TypeError): Cannot read property 'openDialog' of undefined
- React redux - Cannot read property 'state' of undefined
- React & Redux : cannot read property of undefined
- Cannot read property push of undefined for react use history
- React Facebook Login with Enzyme mount - TypeError cannot read property 'parentNode' of undefined
- Using React Redux Loading Bar : Cannot read property 'default' of undefined
- React Redux TypeError: Cannot read property 'map' of undefined
- Uncaught TypeError: Cannot read property 'type' of undefined React Router Redux
- React Redux - Uncaught TypeError: Cannot read property 'setState' of undefined
- React redux TypeError: Cannot read property 'id' of undefined
- React : TypeError : Cannot read property 'fullname' of undefined
- React js and apexcharts Unhandled Rejection TypeError Cannot read property 'length' of undefined
- TypeError: Cannot read property 'map' of undefined in react redux
- React Redux Thunk with callback to another function -- TypeError: Cannot read property 'then' of undefined
- React - uncaught TypeError: Cannot read property 'setState' of undefined
More Query from same tag
- react-leaflet WMSTileLayer 'params' option causes map layer to flicker when any unrelated state variable is updated
- React router works only after refresh
- how to set callback of post request in react with redux, redux-thunk and axios?
- how to use onClick while mapping
- MyApp.getInitialProps return pageProps as empty object
- how to sort "toggle" data on click?
- Value is reset but input is not?
- Is there a way to interact between hook calls within the same react element
- SyntaxError: invalid increment/decrement operand
- Adding Dates in Javascript
- axios doesn't get post request in redux-form
- Call a redux-saga generator function from .map in another function
- reactjs ES6: Unable to understand the syntax
- React js - apply Regex in forms
- How to reset the state in react when component is rendered or shown?
- React useState does not pass in values
- Meteor NodeJs base64 convert back to file
- Drag and Drop in React using hooks
- Fetch request method Get.. How i can get response with query params?
- Search in custom table - React
- How to fix error:only absolute URLS are supported in react ssr graphql
- Make multiple files input with JSON Schema Form (Retool)
- How to URL-encode ParsedUrlQuery?
- Problem using a prop in functional component IT Says TypeError: onClick is not a function
- Generics error with forwardRef: Property 'ref' does not exist on type 'IntrinsicAttributes'
- Remove Scroll EventListener After Firing Once
- How to hide these elements before the user uses the search
- React + vitejs + storybook setup
- set encoded background image via css react
- Import custom tag to TypeScript