2021-10-22 05:16:39 +00:00
|
|
|
#![allow(unused, non_upper_case_globals)]
|
|
|
|
|
2021-09-13 04:59:08 +00:00
|
|
|
//! test that we can display the virtualdom properly
|
|
|
|
//!
|
|
|
|
//!
|
|
|
|
//!
|
|
|
|
|
|
|
|
use dioxus::prelude::*;
|
|
|
|
use dioxus_core as dioxus;
|
2021-09-25 01:46:23 +00:00
|
|
|
use dioxus_core_macro::*;
|
2021-09-13 04:59:08 +00:00
|
|
|
use dioxus_html as dioxus_elements;
|
|
|
|
mod test_logging;
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn please_work() {
|
2021-10-16 21:37:28 +00:00
|
|
|
static App: FC<()> = |(cx, props)| {
|
2021-09-13 04:59:08 +00:00
|
|
|
cx.render(rsx! {
|
|
|
|
div {
|
|
|
|
hidden: "true"
|
|
|
|
"hello"
|
|
|
|
div { "hello" }
|
|
|
|
Child {}
|
|
|
|
Child {}
|
|
|
|
Child {}
|
|
|
|
}
|
|
|
|
div { "hello" }
|
|
|
|
})
|
|
|
|
};
|
|
|
|
|
2021-10-16 21:37:28 +00:00
|
|
|
static Child: FC<()> = |(cx, props)| {
|
2021-09-13 04:59:08 +00:00
|
|
|
cx.render(rsx! {
|
|
|
|
div { "child" }
|
|
|
|
})
|
|
|
|
};
|
|
|
|
|
|
|
|
let mut dom = VirtualDom::new(App);
|
|
|
|
dom.rebuild();
|
|
|
|
|
|
|
|
println!("{}", dom);
|
|
|
|
}
|