Use keyed for recipes now that we have stable keys

This commit is contained in:
Jeremy Wall 2022-08-20 12:59:53 -04:00
parent 91902cebbe
commit ede08f7ef6

View File

@ -46,13 +46,14 @@ pub fn recipe_selector() -> View<G> {
(View::new_fragment( (View::new_fragment(
rows.get().iter().cloned().map(|r| { rows.get().iter().cloned().map(|r| {
view ! { view ! {
div(class="grid") {Indexed(IndexedProps{ div(class="grid") {Keyed(KeyedProps{
iterable: r.handle(), iterable: r.handle(),
template: |(i, recipe)| { template: |(i, recipe)| {
view! { view! {
RecipeSelection(RecipeCheckBoxProps{i: i, title: create_memo(move || recipe.get().title.clone())}) RecipeSelection(RecipeCheckBoxProps{i: i, title: create_memo(move || recipe.get().title.clone())})
} }
}, },
key: |r| r.0.clone(),
})} })}
} }
}).collect() }).collect()