create non generic wrappers for each route

This commit is contained in:
Evan Almloff committed 2023-05-23 19:31:30 -05:00
1 parent 3678fa1d3f
commit d3b21879fb
9 files changed
+58 -32

No files matched your search

+3 -2
View File
@@ -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")