Expose Outlet Context (#3788)

* Expose Outlet Context

* feat(router): expose OutletContext and use_outlet_context for improved accessibility

* Hide OutletContext properties

* Starts from 0 ?

* Clippy fix with Default
This commit is contained in:
Sabin Regmi authored and GitHub committed 2025-03-04 12:34:22 -06:00
1 parent f4c59e1188
commit 6a0ae17d56
3 files changed
+62 -32

No files matched your search

+3 -4
View File
@@ -47,11 +47,10 @@ where
use_hook(|| {
provide_router_context(RouterContext::new(props.config.call(())));
});
provide_context(OutletContext::<R> {
current_level: 0,
_marker: std::marker::PhantomData,
});
use_hook(|| {
provide_context(OutletContext::<R>::new());
});
rsx! { Outlet::<R> {} }