Skip to content

Commit

Permalink
[preact-iso] Fix Router un-rendering incoming same-component route
Browse files Browse the repository at this point in the history
I'm not 100% sure if this is the right solution, but reverting this line fixes the issue:
https://github.com/preactjs/wmr/pull/835/files#diff-b8c8c162d167c1ad31cb8461c49197c9c5527c58c2cde64d5c082d7359878ffdL123

My thinking is that `url` here is the full `location.path + location.search`, so the worst case is that we're potentially re-rendering routers that are unaffected by a given URL change.
  • Loading branch information
developit committed Sep 17, 2021
1 parent b79243a commit 29a8880
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/preact-iso/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export function Router(props) {
});

return h(RouteContext.Provider, { value: m }, p || d);
}, [rest, params]);
}, [url]);

// Reset previous children - if rendering succeeds synchronously, we shouldn't render the previous children.
const p = prev.current;
Expand Down

0 comments on commit 29a8880

Please sign in to comment.