Rsx children

This commit is contained in:
2026-01-30 22:54:56 +01:00
parent 91f0878edc
commit 03191b0a57
5 changed files with 147 additions and 11 deletions
+21
View File
@@ -0,0 +1,21 @@
use std::sync::Arc;
use osui::prelude::*;
pub fn main() {
let engine = Console::new();
engine.run(App {}).expect("Failed to run engine");
}
#[component]
fn App(cx: &Arc<Context>) -> View {
rsx! {
MyComponent { "Hello world!" }
}
.view(cx.clone())
}
#[component]
fn MyComponent(cx: &Arc<Context>, children: &Rsx) -> View {
children.view(cx.clone())
}