![reactjs - react-router throwing TypeError: useContext(...) is undefined when using useHistory - Stack Overflow reactjs - react-router throwing TypeError: useContext(...) is undefined when using useHistory - Stack Overflow](https://i.stack.imgur.com/QKwdZ.png)
reactjs - react-router throwing TypeError: useContext(...) is undefined when using useHistory - Stack Overflow
![types/react-router-dom useHistory, push method does not exist · Issue #40131 · DefinitelyTyped/DefinitelyTyped · GitHub types/react-router-dom useHistory, push method does not exist · Issue #40131 · DefinitelyTyped/DefinitelyTyped · GitHub](https://user-images.githubusercontent.com/19141517/77947325-ab808980-72bb-11ea-92fe-127976d37291.png)
types/react-router-dom useHistory, push method does not exist · Issue #40131 · DefinitelyTyped/DefinitelyTyped · GitHub
![Trying to render a new component on click using useHistory. Keep getting "TypeError: Cannot read property 'push' of undefined" : r/learnjavascript Trying to render a new component on click using useHistory. Keep getting "TypeError: Cannot read property 'push' of undefined" : r/learnjavascript](https://external-preview.redd.it/hbBUAZK6iZW13PeatVMwqi2tbQuLxPXaPMMjFrP2sMc.jpg?auto=webp&s=16028ff35fa1e61c89589c4a0f78c5e0191a581a)
Trying to render a new component on click using useHistory. Keep getting "TypeError: Cannot read property 'push' of undefined" : r/learnjavascript
![Uncaught Could not find router reducer in state tree, it must be mounted under "router" · Issue #312 · supasate/connected-react-router · GitHub Uncaught Could not find router reducer in state tree, it must be mounted under "router" · Issue #312 · supasate/connected-react-router · GitHub](https://user-images.githubusercontent.com/31064652/58316128-73135200-7e45-11e9-9514-1a2208a08b79.png)
Uncaught Could not find router reducer in state tree, it must be mounted under "router" · Issue #312 · supasate/connected-react-router · GitHub
![import error: 'useHistory' is not exported from 'react-router-dom' SOLVED | useHistory was not found - YouTube import error: 'useHistory' is not exported from 'react-router-dom' SOLVED | useHistory was not found - YouTube](https://i.ytimg.com/vi/ntTY9aHmvkw/sddefault.jpg)