dioxus/examples/reference/iterators.rs

19 lines
312 B
Rust
Raw Normal View History

2021-07-02 05:30:52 +00:00
use dioxus::prelude::*;
fn main() {}
static Example: FC<()> = |cx| {
2021-07-11 22:39:45 +00:00
let g = use_state(cx, || 0);
2021-07-05 05:11:49 +00:00
let v = (0..10).map(|f| {
rsx! {
li {
2021-07-11 22:39:45 +00:00
onclick: move |_| g.set(10)
2021-07-05 05:11:49 +00:00
}
}
});
2021-07-02 05:30:52 +00:00
cx.render(rsx! {
div {
2021-07-05 05:11:49 +00:00
{v}
2021-07-02 05:30:52 +00:00
}
})
};