mirror of
https://github.com/leptos-rs/leptos.git
synced 2025-12-27 16:54:41 -05:00
Compare commits
2 Commits
main
...
root-redir
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2c61613b9e | ||
|
|
5caa457a22 |
@@ -37,11 +37,21 @@ where
|
||||
// redirect on the client
|
||||
else {
|
||||
let navigate = use_navigate(cx);
|
||||
#[cfg(any(feature = "csr", feature = "hydrate"))]
|
||||
leptos::request_animation_frame(move || {
|
||||
if let Err(e) = navigate(&path, options.unwrap_or_default()) {
|
||||
leptos::error!("<Redirect/> error: {e:?}");
|
||||
}
|
||||
});
|
||||
#[cfg(not(any(feature = "csr", feature = "hydrate")))]
|
||||
{
|
||||
leptos::debug_warn!(
|
||||
"<Redirect/> is trying to redirect without \
|
||||
`ServerRedirectFunction` being provided. (If you’re getting \
|
||||
this on initial server start-up, it’s okay to ignore. It \
|
||||
just means that your root route is a redirect.)"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user