display_vdom.rs 840 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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_core_macro::*;
  10. use dioxus_html as dioxus_elements;
  11. mod test_logging;
  12. const IS_LOGGING_ENABLED: bool = true;
  13. #[test]
  14. fn please_work() {
  15. static App: FC<()> = |(cx, props)| {
  16. cx.render(rsx! {
  17. div {
  18. hidden: "true"
  19. "hello"
  20. div { "hello" }
  21. Child {}
  22. Child {}
  23. Child {}
  24. }
  25. div { "hello" }
  26. })
  27. };
  28. static Child: FC<()> = |(cx, props)| {
  29. cx.render(rsx! {
  30. div { "child" }
  31. })
  32. };
  33. let mut dom = VirtualDom::new(App);
  34. dom.rebuild();
  35. println!("{}", dom);
  36. }