From 8e1e06d8c3648994d4c77d1174241c95901a597e Mon Sep 17 00:00:00 2001 From: YuKun Liu Date: Mon, 28 Mar 2022 13:11:33 +0800 Subject: [PATCH] fix: docs --- docs/guide/src/interactivity/useref.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/guide/src/interactivity/useref.md b/docs/guide/src/interactivity/useref.md index 15b85dcf5..e8eda8e83 100644 --- a/docs/guide/src/interactivity/useref.md +++ b/docs/guide/src/interactivity/useref.md @@ -60,9 +60,9 @@ The best use case of `use_ref` is to manage "complex" data local to your compone ```rust -let val = use_state(&cx, || vec![1, 3, 3, 7]); -let val = use_state(&cx, || (0..10000).collect::x>()); -let val = use_state(&cx, || Configuration { +let val = use_ref(&cx, || vec![1, 3, 3, 7]); +let val = use_ref(&cx, || (0..10000).collect::x>()); +let val = use_ref(&cx, || Configuration { a: "asdasd", // .. more complex fields }); @@ -82,6 +82,7 @@ fn app(cx: Scope) -> Element { }) } +#[inline_props] fn Child(cx: Scope, val: UseRef) -> Element { // ... }