Rsx children
This commit is contained in:
@@ -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())
|
||||
}
|
||||
Reference in New Issue
Block a user