Closed TristanCacqueray closed 8 months ago
Sure, I think that's reasonable to have. I just hadn't added it since I didn't need it yet.
I've seen some websites abuse the history.replace
which breaks the back button, so be sure to use it very sparingly. It's a very niche feature, not something that is used often.
Great, I need this for my "create" route which can redirect to a "watch" route, and in that case, the back button should jump over the create page. FWIW, I used the fix in this commit: https://github.com/TristanCacqueray/logreduce/commit/1fe774c81db1d26785fe531b59af74615a4fe72c
Looking at the code again, I would argue that calling routing::go_to_url
directly insert history that may not match user clicks, so applications should use link!
if possible.
I would argue that calling routing::go_to_url directly insert history that may not match user clicks, so applications should use link! if possible.
The link!
macro internally uses go_to_url
, it's up to the application to choose how and when it calls go_to_url
. Applications can shoot themself in the foot if they want to, dominator won't stop them.
Would it be acceptable to add a
replace_url
helper that useshistory.replace
instead ofhistory.push
, so that the current page is removed from the history?