From db54986482b97727d531e1d4ada12b4117cc3e0c Mon Sep 17 00:00:00 2001 From: PedroHBrasil Date: Thu, 5 Oct 2023 14:13:06 -0300 Subject: [PATCH] Fixed first code of Guide -> State page. --- src/doc_examples/hackernews_state.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/doc_examples/hackernews_state.rs b/src/doc_examples/hackernews_state.rs index b05f5d64d..a6f213f52 100644 --- a/src/doc_examples/hackernews_state.rs +++ b/src/doc_examples/hackernews_state.rs @@ -86,6 +86,27 @@ pub mod app_v1 { } } } + + // NEW + #[inline_props] + fn Comment(cx: Scope, comment: Comment) -> Element<'a> { + render! { + div { + padding: "0.5rem", + div { + color: "gray", + "by {comment.by}" + } + div { + dangerous_inner_html: "{comment.text}" + } + for kid in &comment.sub_comments { + Comment { comment: kid.clone() } + } + } + } + } + // ANCHOR_END: app_v1 #[inline_props]