You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, Sycamore's router supports navigating to a new page and also replacing the current entry in the history. Extending on this, it would be useful if the router could reload the current route. At first, I know this seems completely pointless, but, as I've discovered through Perseus' state freezing, it's not! Right now, if you call navigate(url) where url is the same as the current page, the code in the Router callback doesn't run, nor should it.
However, there are cases, particularly for high-level contexts that have been updated, in which reloading a page with new state is extremely useful. This seems to be the offending code:
While I accept that this is a great default, it would be very useful to have a function that bypasses it to enable reloading the current route. Notably, this would probably require a not insignificant refactor of the router, which I'm probably not the best person to attempt due to my unfamiliarity with its intricacies.
The text was updated successfully, but these errors were encountered:
Right now, Sycamore's router supports navigating to a new page and also replacing the current entry in the history. Extending on this, it would be useful if the router could reload the current route. At first, I know this seems completely pointless, but, as I've discovered through Perseus' state freezing, it's not! Right now, if you call
navigate(url)
whereurl
is the same as the current page, the code in theRouter
callback doesn't run, nor should it.However, there are cases, particularly for high-level contexts that have been updated, in which reloading a page with new state is extremely useful. This seems to be the offending code:
sycamore/packages/sycamore-router/src/router.rs
Lines 112 to 113 in 8634331
While I accept that this is a great default, it would be very useful to have a function that bypasses it to enable reloading the current route. Notably, this would probably require a not insignificant refactor of the router, which I'm probably not the best person to attempt due to my unfamiliarity with its intricacies.
The text was updated successfully, but these errors were encountered: