Lazy Routes for views with props #4508
-
|
Hi, For a bit more detail, I have a few cases in my app where some state (e.g. a signal) is created in the route definition component and then shared between multiple child routes (example below). #[component(transparent)]
pub fn FooRoutes() -> impl MatchNestedRoutes + Clone {
let state = RwSignal::new(true);
view! {
<ParentRoute path=path!("foo") view=Outlet>
<Route path=path!("a") view=move || view! { <ViewA state /> } />
<Route path=path!("b") view=move || view! { <ViewB state /> } />
</ParentRoute>
}
}So, my question is: is there a way to split out |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
You can provide |
Beta Was this translation helpful? Give feedback.
You can provide
statevia context.