component generator
This commit is contained in:
@@ -4,16 +4,13 @@ use osui::prelude::*;
|
||||
|
||||
pub fn main() {
|
||||
let engine = Console::new();
|
||||
engine.run(App).expect("Failed to run engine");
|
||||
engine.run(App {}).expect("Failed to run engine");
|
||||
}
|
||||
|
||||
struct App;
|
||||
|
||||
impl ComponentImpl for App {
|
||||
fn call(&self, cx: &Arc<Context>) -> View {
|
||||
rsx! {
|
||||
"Hello, world!"
|
||||
}
|
||||
.view(cx.clone())
|
||||
#[component]
|
||||
fn App(cx: &Arc<Context>) -> View {
|
||||
rsx! {
|
||||
"Hello World"
|
||||
}
|
||||
.view(cx.clone())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user