dioxus/examples/reference/iterators.rs

19 lines
322 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-05 05:11:49 +00:00
let (g, set_g) = use_state(&cx, || 0);
let v = (0..10).map(|f| {
rsx! {
li {
onclick: move |_| set_g(10)
}
}
});
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
}
})
};