Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

useHistory was not found in react-router-dom #1243

Open
SelvaRMmalar opened this issue Feb 2, 2023 · 1 comment
Open

useHistory was not found in react-router-dom #1243

SelvaRMmalar opened this issue Feb 2, 2023 · 1 comment
Labels
enhancement New feature request p3 Priority 3

Comments

@SelvaRMmalar
Copy link

I got this error from RouteChangeListener. In there, useHistory is used to navigation.
I'm currently using react-router-dom version 6.4.5. But useHistory was not found in that version. Is it possible to upgrade your react-router-dom.

@jeremytchang jeremytchang added p3 Priority 3 enhancement New feature request labels Feb 22, 2023
@SelvaRMmalar
Copy link
Author

When we update the new version, we still got the same error, because it is still using the useHistory function to get the navigation history.
var history = (0, _reactRouterDom.useHistory)();
I think it is better to use the useNavigate function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature request p3 Priority 3
Projects
None yet
Development

No branches or pull requests

2 participants