Skip to content

Fix "Edit this page" URL not updating on soft navigation#635

Merged
ealmloff merged 1 commit intoDioxusLabs:mainfrom
tomocrafter:fix/edit-page-url-soft-navigation
Mar 10, 2026
Merged

Fix "Edit this page" URL not updating on soft navigation#635
ealmloff merged 1 commit intoDioxusLabs:mainfrom
tomocrafter:fix/edit-page-url-soft-navigation

Conversation

@tomocrafter
Copy link
Contributor

Summary

  • The "Edit this page" link in RightNav was stuck on the URL from the initial page load and never updated during client-side (soft) navigation.
  • Root cause: page (a plain Copy value from R::use_route()) was captured by value into a use_memo closure, giving the memo no reactive dependencies. Since the memo never re-evaluated, the use_resource that depended on it also never re-ran.
  • Fix: Remove the intermediate use_memo and use use_resource(use_reactive!(|(page,)| ...)) so the resource re-runs whenever the route changes.

Test plan

  • Open any docs page
  • Navigate to a different page via sidebar (soft navigation)
  • Verify the "Edit this page" link URL updates to match the current page

The edit_github_url resource in RightNav was never re-running on route
changes because page (a plain Copy value) was captured by value into
use_memo, giving the memo no reactive dependencies.

Replace use_memo + use_resource with use_resource(use_reactive!(...))
so the resource re-runs whenever page changes.
Copy link
Member

@ealmloff ealmloff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ealmloff ealmloff merged commit 5dc3901 into DioxusLabs:main Mar 10, 2026
1 check passed
@ealmloff ealmloff added the bug Something isn't working label Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants