wip: update hooks

This commit is contained in:
Jonathan Kelley committed 2021-12-13 00:14:47 -05:00
1 parent 96b3d56e09
commit 597a0456f5
6 files changed
+30 -21

No files matched your search

+3 -2
View File
@@ -3,9 +3,10 @@ use std::{
rc::Rc,
};
use dioxus_core::Context;
use dioxus_core::AnyContext;
pub fn use_ref<T: 'static>(cx: Context, f: impl FnOnce() -> T) -> UseRef<T> {
pub fn use_ref<'a, T: 'static>(cx: &dyn AnyContext<'a>, f: impl FnOnce() -> T) -> UseRef<'a, T> {
let cx = cx.get_scope();
cx.use_hook(
|_| UseRefInner {
update_scheduled: Cell::new(false),