Browse Source

docs: allow build core_reference/children example

It needs lifetime parameters.
yuniruyuni 3 years ago
parent
commit
388acf3277
1 changed files with 2 additions and 2 deletions
  1. 2 2
      examples/core_reference/children.rs

+ 2 - 2
examples/core_reference/children.rs

@@ -32,11 +32,11 @@ fn Example(cx: Scope) -> Element {
 }
 }
 
 
 #[derive(Props)]
 #[derive(Props)]
-struct BannerProps {
+struct BannerProps<'a> {
     children: Element<'a>,
     children: Element<'a>,
 }
 }
 
 
-fn Banner(cx: Scope) -> Element {
+fn Banner<'a>(cx: Scope<'a, BannerProps<'a>>) -> Element<'a> {
     cx.render(rsx! {
     cx.render(rsx! {
         div {
         div {
             h1 { "This is a great banner!" }
             h1 { "This is a great banner!" }