it almost lives?

This commit is contained in:
Evan Almloff committed 2023-07-25 18:14:48 -07:00
1 parent d637ef187c
commit 5f0dd3af3e
43 files changed
+506 -244

No files matched your search

+6 -6
View File
@@ -3,13 +3,13 @@ use dioxus::prelude::*;
/// An outlet for the current content.
///
/// Only works as descendant of a [`GenericRouter`] component, otherwise it will be inactive.
/// Only works as descendant of a [`Link`] component, otherwise it will be inactive.
///
/// The [`GenericOutlet`] is aware of how many [`GenericOutlet`]s it is nested within. It will render the content
/// The [`Outlet`] is aware of how many [`Outlet`]s it is nested within. It will render the content
/// of the active route that is __exactly as deep__.
///
/// # Panic
/// - When the [`GenericOutlet`] is not nested a [`GenericRouter`] component,
/// - When the [`Outlet`] is not nested a [`Link`] component,
/// but only in debug builds.
///
/// # Example
@@ -42,7 +42,7 @@ use dioxus::prelude::*;
/// fn Wrapper(cx: Scope) -> Element {
/// render! {
/// h1 { "App" }
/// Outlet {} // The content of child routes will be rendered here
/// Outlet::<Route> {} // The content of child routes will be rendered here
/// }
/// }
///
@@ -57,7 +57,7 @@ use dioxus::prelude::*;
///
/// # fn App(cx: Scope) -> Element {
/// # render! {
/// # Router {
/// # Router::<Route> {
/// # config: || RouterConfig::default().history(MemoryHistory::with_initial_path(Route::Child {}))
/// # }
/// # }
@@ -67,6 +67,6 @@ use dioxus::prelude::*;
/// # let _ = vdom.rebuild();
/// # assert_eq!(dioxus_ssr::render(&vdom), "<h1>App</h1><p>Child</p>");
/// ```
pub fn GenericOutlet<R: Routable + Clone>(cx: Scope) -> Element {
pub fn Outlet<R: Routable + Clone>(cx: Scope) -> Element {
OutletContext::<R>::render(cx)
}