mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-11 07:04:13 +00:00
67dc6e6017
* feat: implement type magic * chore: undo example * fix: let tests pass * chore: add generic to allow any nesting of iterators * Chore: remove comments * chore: update rsx usage * chore: use cleaner version of generic IntoVnode * chore: don't derive default for lfietimed thing * chore: remove latent comment * fix: accept a third parameter
19 lines
466 B
Rust
19 lines
466 B
Rust
use dioxus::prelude::*;
|
|
|
|
fn main() {
|
|
dioxus_desktop::launch(app);
|
|
}
|
|
|
|
fn app(cx: Scope) -> Element {
|
|
cx.render(rsx!(
|
|
// Use Map directly to lazily pull elements
|
|
(0..10).map(|f| rsx! { "{f}" }),
|
|
// Collect into an intermediate collection if necessary
|
|
["a", "b", "c"]
|
|
.into_iter()
|
|
.map(|f| rsx! { "{f}" })
|
|
.collect::<Vec<_>>(),
|
|
// Use optionals
|
|
Some(rsx! { "Some" }),
|
|
))
|
|
}
|