From 7c2d911fbf1abb23a216f3ef5c235bc75766ee4a Mon Sep 17 00:00:00 2001 From: Dave Rolsky Date: Tue, 15 Feb 2022 09:54:32 -0600 Subject: [PATCH] Fix closure signature for use_ref example in interactivity docs The example showed the closure accepting a single argument, but it accepts none. --- docs/guide/src/interactivity/hooks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide/src/interactivity/hooks.md b/docs/guide/src/interactivity/hooks.md index a90afe2dc..a84a0b129 100644 --- a/docs/guide/src/interactivity/hooks.md +++ b/docs/guide/src/interactivity/hooks.md @@ -140,7 +140,7 @@ fn Child(cx: Scope, name: String) -> Element { // ✅ Or, use a hashmap with use_ref ```rust -let ages = use_ref(&cx, |_| HashMap::new()); +let ages = use_ref(&cx, || HashMap::new()); names.iter().map(|name| { let age = ages.get(name).unwrap();