2021-07-29 01:46:53 +00:00
|
|
|
#![allow(non_upper_case_globals)]
|
|
|
|
|
2021-07-11 23:31:07 +00:00
|
|
|
use dioxus::prelude::*;
|
|
|
|
use dioxus::ssr;
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let mut vdom = VirtualDom::new(App);
|
2021-08-18 02:25:09 +00:00
|
|
|
// vdom.rebuild_in_place().expect("Rebuilding failed");
|
2021-07-29 01:46:53 +00:00
|
|
|
println!("{}", ssr::render_vdom(&vdom, |c| c));
|
2021-07-11 23:31:07 +00:00
|
|
|
}
|
|
|
|
|
2021-07-29 01:46:53 +00:00
|
|
|
static App: FC<()> = |cx| {
|
2021-07-11 23:31:07 +00:00
|
|
|
cx.render(rsx!(
|
|
|
|
div {
|
|
|
|
h1 { "Title" }
|
|
|
|
p { "Body" }
|
|
|
|
}
|
|
|
|
))
|
|
|
|
};
|
2021-08-18 02:25:09 +00:00
|
|
|
|
|
|
|
struct MyProps<'a> {
|
|
|
|
text: &'a str,
|
|
|
|
}
|
|
|
|
fn App2<'a>(cx: Context<'a, MyProps>) -> DomTree<'a> {
|
|
|
|
None
|
|
|
|
}
|