fragment_from_iter.rs 1.1 KB

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