Struct sycamore::flow::Keyed [−][src]
pub struct Keyed<G: GenericNode, T: 'static, F: 'static, K: 'static, Key: 'static> { /* fields omitted */ }
Expand description
Keyed iteration. Use this instead of directly rendering an array of Template
s.
Using this will minimize re-renders instead of re-rendering every single node on every state
change.
For non keyed iteration, see Indexed
.
Example
use sycamore::prelude::*;
let count = Signal::new(vec![1, 2]);
let node = template! {
Keyed(KeyedProps {
iterable: count.handle(),
template: |item| template! {
li { (item) }
},
key: |item| *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 = KeyedProps<T, F, G, K, Key>
type Props = KeyedProps<T, F, G, K, Key>
The type of the properties passed to the component.
Create a new component with an instance of the properties. Read more