Navigate can't push state inside <HashRouter> #8917
Unanswered
tonywang402
asked this question in
v5 to v6 Migration
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When I use
navigate
fromreact-router-dom-v5-compat
to push state inside , which will not work and throw a warningHash history cannot push state; it is ignored
When I change to < BrowserRouter >, It can work
Also, When I converted all of our code, remove the compatibility package and install React Router DOM v6 directly, which can work inside
But in our project, we use and a lot of like
history.push({pathname: '...', state: {id: 123}})
, we want to incrementally migrate and don't changeBeta Was this translation helpful? Give feedback.
All reactions