[Docs/Question/Bug]: Re-renders on location.key
change
#8025
Replies: 2 comments 5 replies
-
Also, the behavior you describe in your second bullet point has been "fixed" (changed, really) in 5.2.1: https://github.com/remix-run/react-router/releases/tag/v5.2.1 |
Beta Was this translation helpful? Give feedback.
-
We are seeing a similar issue with re-sizing the viewport. We get a new location.key for some reason, though I can't see a good reason for the history entry. I don't think the user would expect the back button to restore the previous browser window size. We are still using react-router 5.1.2, so I'll let you know what happens after upgrade to 5.2.1+. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm not sure if this is a docs request, a question, or a bug report, so I apologize in advance 😅
I'm having a re-render issue that, after a log of search, profiling, then docs digging and googling on the best solution besides my weird one, I found that someone else had the same issue and solution. So I wonder:
location.key
exactly for? Should this be in the docs? If we go tolocation
, all it says is its shape; while most are obvious, thekey
isn't really... I understand it seems to come from the history package, but when you're implementing the Router you may not realize you should look for two different sets of docs, so maybe add a link or a simple description there?<NavLink to="/orders">
that re-renders the selected route with every click, even if the current route is exactly that. It seems to happen because of thelocation.key
change.Beta Was this translation helpful? Give feedback.
All reactions