Open adibsaad opened 1 year ago
Worth noting: if I make separate components and use them for the route element, the bug still exists https://codesandbox.io/p/sandbox/charming-thunder-jxh8zg
I can confirm this is happening. I tried downgrading to version 1.1.1
-- same issue. Really strange. I remember testing something similar before adopting the library and didn't encounter this.
From testing, I believe this is because RRv6 tries to prevent rerenders as much as possible, whereas this library only reconciles document.title
on render.
If I add a useLocation
hook to my component for example, the title updates correctly.
Considering adding some sort of dependence on the location to manage this, I'm not sure what the right answer is...
Hello, Thank you for making this library. It is much-needed! 😄
I was trying to use this in my app with react-router, but I'm running into a bug where the title doesn't get updated when navigating from a child route to parent route or from a route with a Titled to a route without one.
Code: https://codesandbox.io/p/sandbox/snowy-cloud-x9z7lq Demo: https://x9z7lq-5173.csb.app/
To replicate the first issue:
path2-1 - path2 - Top
path2 - Top
but it hasn't changedTo replicate the second issue
path1 - Top
Top
but it hasn't changed