display_vdom.rs 810 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //! test that we can display the virtualdom properly
  2. //!
  3. //!
  4. //!
  5. use std::{cell::RefCell, rc::Rc};
  6. use anyhow::{Context, Result};
  7. use dioxus::prelude::*;
  8. use dioxus_core as dioxus;
  9. use dioxus_html as dioxus_elements;
  10. mod test_logging;
  11. const IS_LOGGING_ENABLED: bool = true;
  12. #[test]
  13. fn please_work() {
  14. static App: FC<()> = |cx, props| {
  15. cx.render(rsx! {
  16. div {
  17. hidden: "true"
  18. "hello"
  19. div { "hello" }
  20. Child {}
  21. Child {}
  22. Child {}
  23. }
  24. div { "hello" }
  25. })
  26. };
  27. static Child: FC<()> = |cx, props| {
  28. cx.render(rsx! {
  29. div { "child" }
  30. })
  31. };
  32. let mut dom = VirtualDom::new(App);
  33. dom.rebuild();
  34. println!("{}", dom);
  35. }