dioxus/packages/core/tests/display_vdom.rs

43 lines
810 B
Rust
Raw Normal View History

//! test that we can display the virtualdom properly
//!
//!
//!
use std::{cell::RefCell, rc::Rc};
use anyhow::{Context, Result};
use dioxus::prelude::*;
use dioxus_core as dioxus;
use dioxus_html as dioxus_elements;
mod test_logging;
const IS_LOGGING_ENABLED: bool = true;
#[test]
fn please_work() {
2021-09-21 17:13:15 +00:00
static App: FC<()> = |cx, props| {
cx.render(rsx! {
div {
hidden: "true"
"hello"
div { "hello" }
Child {}
Child {}
Child {}
}
div { "hello" }
})
};
2021-09-21 17:13:15 +00:00
static Child: FC<()> = |cx, props| {
cx.render(rsx! {
div { "child" }
})
};
let mut dom = VirtualDom::new(App);
dom.rebuild();
println!("{}", dom);
}