dioxus/packages/core/examples/alternative.rs

24 lines
547 B
Rust
Raw Normal View History

2021-07-18 16:39:32 +00:00
use dioxus_core::prelude::*;
fn main() {}
2021-07-18 16:39:32 +00:00
pub static Example: FC<()> = |cx| {
let list = (0..10).map(|f| LazyNodes::new(move |f| todo!()));
2021-07-11 23:31:07 +00:00
2021-07-18 16:39:32 +00:00
cx.render(LazyNodes::new(move |cx| {
let bump = cx.bump();
cx.raw_element(
"div",
None,
&mut [],
&mut [],
cx.bump().alloc([
cx.text(format_args!("hello")),
cx.text(format_args!("hello")),
cx.fragment_from_iter(list),
]),
None,
)
}))
};