create non generic wrappers for each route
This commit is contained in:
1 parent
3678fa1d3f
commit
d3b21879fb
9 files changed
+58
-32
No files matched your search
@@ -1,11 +1,12 @@
|
||||
use dioxus::prelude::ScopeState;
|
||||
|
||||
use crate::{
|
||||
prelude::RouterContext, routable::Routable, utils::use_router_internal::use_router_internal,
|
||||
prelude::GenericRouterContext, routable::Routable,
|
||||
utils::use_router_internal::use_router_internal,
|
||||
};
|
||||
|
||||
/// A hook that provides access to information about the router
|
||||
pub fn use_router<R: Routable + Clone>(cx: &ScopeState) -> &RouterContext<R> {
|
||||
pub fn use_generic_router<R: Routable + Clone>(cx: &ScopeState) -> &GenericRouterContext<R> {
|
||||
use_router_internal(cx)
|
||||
.as_ref()
|
||||
.expect("use_route must have access to a router")
|
||||
|
||||
Reference in new issue
Block a user