diff --git a/docs/concepts/html/components.md b/docs/concepts/html/components.md index 7b8e9f51915..a724fccedb6 100644 --- a/docs/concepts/html/components.md +++ b/docs/concepts/html/components.md @@ -42,7 +42,7 @@ html! { ```rust pub struct Container(Props); -#[derive(Properties)] +#[derive(Properties, Clone)] pub struct Props { pub children: Children, } @@ -63,6 +63,8 @@ impl Component for Container { ``` {% endcode %} +{% hint style="info" %} Types for which you derive `Properties` must also implement `Clone`. This can be done by either using `#[derive(Properties, Clone)]` or manually implementing `Clone` for your type. {% endhint %} + ## Nested Children with Props Nested component properties can be accessed and mutated if the containing component types its children. @@ -86,7 +88,7 @@ html! { ```rust pub struct List(Props); -#[derive(Properties)] +#[derive(Properties, Clone)] pub struct Props { pub children: ChildrenWithProps, } @@ -107,4 +109,3 @@ impl Component for List { } ``` {% endcode %} -