Explorar o código

Merge pull request #119 from yuniruyuni/docs/add-lifetime-for-children-example

Jonathan Kelley %!s(int64=3) %!d(string=hai) anos
pai
achega
8b75c811a2
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  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)]
-struct BannerProps {
+struct BannerProps<'a> {
     children: Element<'a>,
 }
 
-fn Banner(cx: Scope) -> Element {
+fn Banner<'a>(cx: Scope<'a, BannerProps<'a>>) -> Element<'a> {
     cx.render(rsx! {
         div {
             h1 { "This is a great banner!" }