fix tests

This commit is contained in:
Evan Almloff 2023-06-30 12:56:22 -07:00
parent 60b25e9c2f
commit a6e87cf340
3 changed files with 3 additions and 6 deletions

View file

@ -21,3 +21,4 @@ log = { workspace = true }
futures-util = { workspace = true, default-features = false } futures-util = { workspace = true, default-features = false }
dioxus-core = { workspace = true } dioxus-core = { workspace = true }
dioxus = { workspace = true } dioxus = { workspace = true }
web-sys = { version = "0.3.64", features = ["Document", "Window", "Element"] }

View file

@ -22,7 +22,7 @@ macro_rules! to_owned {
} }
mod use_on_unmount; mod use_on_unmount;
pub use use_on_unmount; pub use use_on_unmount::*;
mod usecontext; mod usecontext;
pub use usecontext::*; pub use usecontext::*;

View file

@ -4,10 +4,6 @@
/// ```rust /// ```rust
/// use dioxus::prelude::*; /// use dioxus::prelude::*;
/// fn main() {
/// dioxus_web::launch(app)
/// }
/// fn app(cx: Scope) -> Element { /// fn app(cx: Scope) -> Element {
/// let state = use_state(cx, || true); /// let state = use_state(cx, || true);
/// render! { /// render! {
@ -60,7 +56,7 @@
/// } /// }
/// } /// }
/// ``` /// ```
pub fn use_on_unmount<C: FnOnce() + 'static, D: FnOnce() + 'static>(cx: &ScopeState, destroy: D) { pub fn use_on_unmount<D: FnOnce() + 'static>(cx: &dioxus_core::ScopeState, destroy: D) {
cx.use_hook(|| LifeCycle { cx.use_hook(|| LifeCycle {
ondestroy: Some(destroy), ondestroy: Some(destroy),
}); });