Why using <Navigate/> to same page with different URL params doesn't update window.location.pathname? #11202
Unanswered
SCSR-is-too-short-username
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The title should pretty much say everything. Basically the idea I'm going for is that the site has a view/edit page for database items. I'm adding a page that allows user to add items to the database. This is done by recycling the edit page, but using URL params to tell the page that it is it "add mode". After the user gets response that adding the asset was successful, I'm using
<Navigate/>
component to change the page to the "view mode" by changing the URL params. The URL params change in the browser URL bar, butwindow.location.pathname
still has the old params. I don't know if this is the correct way of doing this, but usingwindow.location.pathname
to get the URL params has worked so far. Is there a simple way to fix this? I'm working with a class component if that is relevant.Beta Was this translation helpful? Give feedback.
All reactions