leptos_router 0.0.1

Router for the Leptos web framework.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use crate::use_route;
use leptos::*;

#[component]
pub fn Outlet(cx: Scope) -> Child {
    let route = use_route(cx);
    if let Some(child) = route.child() {
        provide_context(child.cx(), child.clone());
        child.outlet().into_child(child.cx())
    } else {
        String::new().into_child(cx)
    }
}