dioxus/examples/reference/iterators.rs
2021-07-05 01:11:49 -04:00

18 lines
322 B
Rust

use dioxus::prelude::*;
fn main() {}
static Example: FC<()> = |cx| {
let (g, set_g) = use_state(&cx, || 0);
let v = (0..10).map(|f| {
rsx! {
li {
onclick: move |_| set_g(10)
}
}
});
cx.render(rsx! {
div {
{v}
}
})
};