dioxus/examples/readme.rs

23 lines
421 B
Rust
Raw Normal View History

2022-01-01 06:08:31 +00:00
use dioxus::prelude::*;
fn main() {
let mut dom = VirtualDom::new(app);
dom.rebuild();
2022-01-01 14:49:08 +00:00
rink::render_vdom(&mut dom).unwrap();
2022-01-01 06:08:31 +00:00
}
fn app(cx: Scope) -> Element {
cx.render(rsx! {
div {
width: "100%",
height: "10px",
background_color: "red",
justify_content: "center",
align_items: "center",
"Hello world!"
}
})
}