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]