fragment_from_iter.rs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. fn main() {}
  2. use dioxus_core::prelude::*;
  3. fn App(cx: Context<()>) -> DomTree {
  4. //
  5. let vak = cx.use_suspense(
  6. || async {},
  7. |c, res| {
  8. //
  9. c.render(LazyNodes::new(move |f| f.text(format_args!(""))))
  10. },
  11. );
  12. let d1 = cx.render(LazyNodes::new(move |f| {
  13. f.raw_element(
  14. "div",
  15. None,
  16. &mut [],
  17. &[],
  18. f.bump().alloc([
  19. f.fragment_from_iter(vak),
  20. f.text(format_args!("")),
  21. f.text(format_args!("")),
  22. f.text(format_args!("")),
  23. f.text(format_args!("")),
  24. ]),
  25. None,
  26. )
  27. }));
  28. cx.render(LazyNodes::new(move |f| {
  29. f.raw_element(
  30. "div",
  31. None,
  32. &mut [],
  33. &[],
  34. f.bump().alloc([
  35. f.text(format_args!("")),
  36. f.text(format_args!("")),
  37. f.text(format_args!("")),
  38. f.text(format_args!("")),
  39. f.fragment_from_iter(d1),
  40. ]),
  41. None,
  42. )
  43. }))
  44. }