Make deprecated use router (#1260)

* make router props expansion better

* fix router data fields

* make a deprecated use_router hook
This commit is contained in:
ealmloff authored and GitHub committed 2023-07-27 10:32:23 -07:00
1 parent 5e3451a6f2
commit cfd62e274e
12 files changed
+82 -149

No files matched your search

+2 -6
View File
@@ -35,17 +35,13 @@ impl Navigator {
///
/// The previous location will be available to go back to.
pub fn push(&self, target: impl Into<IntoRoutable>) -> Option<ExternalNavigationFailure> {
let target = target.into();
let as_any_navigation_target = self.0.resolve_into_routable(&target);
self.0.push_any(as_any_navigation_target)
self.0.push(target)
}
/// Replace the current location.
///
/// The previous location will **not** be available to go back to.
pub fn replace(&self, target: impl Into<IntoRoutable>) -> Option<ExternalNavigationFailure> {
let target = target.into();
let as_any_navigation_target = self.0.resolve_into_routable(&target);
self.0.replace_any(as_any_navigation_target)
self.0.replace(target)
}
}