Remove argument from use_hook closure (#496)

Also; update docs for said function
This commit is contained in:
Reinis Mazeiks authored and GitHub committed 2022-07-11 15:50:56 -04:00
1 parent 6ea076fa7f
commit d734dc5b46
29 files changed
+53 -55

No files matched your search

+1 -1
View File
@@ -4,7 +4,7 @@ use std::rc::Rc;
// Initializes the atom root and retuns it;
pub fn use_init_atom_root(cx: &ScopeState) -> &Rc<AtomRoot> {
cx.use_hook(|_| match cx.consume_context::<Rc<AtomRoot>>() {
cx.use_hook(|| match cx.consume_context::<Rc<AtomRoot>>() {
Some(ctx) => ctx,
None => cx.provide_context(Rc::new(AtomRoot::new(cx.schedule_update_any()))),
})