Struct sycamore::flow::Indexed [−][src]
pub struct Indexed<G: Html, T: 'static, F: 'static> { /* fields omitted */ }
Expand description
Non keyed iteration (or keyed by index). Use this instead of directly rendering an array of
View
s. Using this will minimize re-renders instead of re-rendering every single
node on every state change.
For keyed iteration, see Keyed
.
Example
use sycamore::prelude::*;
let count = Signal::new(vec![1, 2]);
let node = view! {
Indexed(IndexedProps {
iterable: count.handle(),
template: |item| view! {
li { (item) }
},
})
};
Trait Implementations
The name of the component (for use in debug mode). In release mode, this will default to
"UnnamedComponent"
Read more
type Props = IndexedProps<T, F, G>
type Props = IndexedProps<T, F, G>
The type of the properties passed to the component.
Create a new component with an instance of the properties.