소스 검색

docs: allow build core_reference/children example

It needs lifetime parameters.
yuniruyuni 3 년 전
부모
커밋
388acf3277
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  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!" }