Closed Baptistemontan closed 1 month ago
Found a work around in the mean time, just wait for the navigation to finish before triggering a new one, did it by waiting for an animation frame:
Effect::new(move || {
if location.pathname.with(|path| path == "/counter") {
let navigate = navigate.clone();
request_animation_frame(move || {
navigate(
"/",
NavigateOptions {
resolve: false,
replace: true,
scroll: false,
..Default::default()
},
)
})
}
});
Describe the bug A clear and concise description of what the bug is.
Leptos Dependencies
Please copy and paste the Leptos dependencies and features from your
Cargo.toml
.For example:
To Reproduce
In this example, when clicking the anchor in the
Home
component, it navigates to theCounter
component at/counter
, but the effect trigger another redirect to stay at theHome
page, it works as expected, you stay at the Home page, but the url stays/counter
. And it also shows thatlocation.pathname
is/
.Expected behavior That the url is kept in sync.
Additionnal context It worked fine in 0.6