This repository has been archived by the owner on Jan 11, 2023. It is now read-only.
Ensure deepest layout is always refreshed on goto #484
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See: #349, #483's ps.
This PR just forces the deepest page component to refresh on
goto
, even if that'sgoto(currentPage)
. This ensures that a change to a query param triggers a navigation.One might argue that
goto(currentPage)
should be a noop, but I'd argue otherwise for two reasons:Plain old regular links to the current page aren't noop, and thus users' expectation is that the page will refresh. If you're on hackernews' homepage and click its logo, would you expect it not to refresh revealing the freshest pile of nonsense?
navigate(currentPage)
could be implemented as user code to be noop or not on top of agoto
that always navigates. The opposite isn't true: ifgoto(currentPage)
is a noop, we can't have a userlandnavigate
that works differently.This should probably still be polished (especially if #483 is something we'd like to do), but I think it should work for a temporary fix.