Merge pull request #252 from autarch/autarch/fix-use_ref-doc-example

Fix closure signature for use_ref example in interactivity docs
This commit is contained in:
Jonathan Kelley authored and GitHub committed 2022-02-15 10:57:51 -05:00
commit d2fbebf853
1 file changed
+1 -1
+1 -1
View File
@@ -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();