diff --git a/packages/yew/src/virtual_dom/vlist.rs b/packages/yew/src/virtual_dom/vlist.rs index 70198429df5..32094f78b1a 100644 --- a/packages/yew/src/virtual_dom/vlist.rs +++ b/packages/yew/src/virtual_dom/vlist.rs @@ -132,21 +132,9 @@ impl VList { /// Creates a new [VList] instance with children. pub fn with_children(children: Vec, key: Option) -> Self { - if children.is_empty() { - VList { - fully_keyed: FullyKeyedState::KnownFullyKeyed, - children: None, - key, - } - } else { - let mut vlist = VList { - fully_keyed: FullyKeyedState::Unknown, - children: Some(Rc::new(children)), - key, - }; - vlist.recheck_fully_keyed(); - vlist - } + let mut vlist = VList::from(children); + vlist.key = key; + vlist } // Returns a mutable reference to children, allocates the children if it hasn't been done.