You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I've got the same question as this dude here https://stackoverflow.com/questions/57101831/react-router-how-do-i-update-the-url-without-causing-a-navigation-reload
but there was no real go-to now how we should do it, because e.g the first answer to that question might cause problems "Beware that this change might bypass React Router's knowledge of the current path if it is again modified later. E.G. if you append 1 sub path using this method and then use RR to navigate up 1 level, it will visually jump 2 because RR still thinks the location is without the appended sub path. – Magnus Bull"
What's the recommended way to change/update the URL?
e.g user opens the german site of mywebsite.com/de but I know his settings that he prefers the spanish language, so I render the spanish text instead of the german text, and change the URL appropriately to mywebsite.com/es
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, I've got the same question as this dude here https://stackoverflow.com/questions/57101831/react-router-how-do-i-update-the-url-without-causing-a-navigation-reload
but there was no real go-to now how we should do it, because e.g the first answer to that question might cause problems "Beware that this change might bypass React Router's knowledge of the current path if it is again modified later. E.G. if you append 1 sub path using this method and then use RR to navigate up 1 level, it will visually jump 2 because RR still thinks the location is without the appended sub path. –
Magnus Bull"
What's the recommended way to change/update the URL?
e.g user opens the german site of mywebsite.com/de but I know his settings that he prefers the spanish language, so I render the spanish text instead of the german text, and change the URL appropriately to mywebsite.com/es
What's the best way to do that?
Beta Was this translation helpful? Give feedback.
All reactions