Remove argument from use_hook closure (#496)
Also; update docs for said function
This commit is contained in:
1 parent
6ea076fa7f
commit
d734dc5b46
29 files changed
+53
-55
No files matched your search
@@ -111,7 +111,7 @@ use std::{
|
||||
/// })
|
||||
/// ```
|
||||
pub fn use_ref<T: 'static>(cx: &ScopeState, initialize_refcell: impl FnOnce() -> T) -> &UseRef<T> {
|
||||
let hook = cx.use_hook(|_| UseRef {
|
||||
let hook = cx.use_hook(|| UseRef {
|
||||
update: cx.schedule_update(),
|
||||
value: Rc::new(RefCell::new(initialize_refcell())),
|
||||
dirty: Rc::new(Cell::new(false)),
|
||||
|
||||
Reference in new issue
Block a user