1
0

component_child.rs 483 B

1234567891011121314151617181920212223242526272829
  1. use std::{ops::Deref, rc::Rc};
  2. use dioxus::virtual_dom::Scope;
  3. use dioxus_core::prelude::*;
  4. type RcStr = Rc<str>;
  5. fn main() {
  6. let r: RcStr = "asdasd".into();
  7. let r: RcStr = String::from("asdasd").into();
  8. let g = rsx! {
  9. div {
  10. Example {}
  11. }
  12. };
  13. }
  14. static Example: FC<()> = |ctx| {
  15. let nodes = ctx.children();
  16. //
  17. rsx! { in ctx,
  18. div {
  19. h1 {"these are children nodes: "}
  20. {nodes}
  21. }
  22. }
  23. };