mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-23 12:43:08 +00:00
fix tests
This commit is contained in:
parent
60b25e9c2f
commit
a6e87cf340
3 changed files with 3 additions and 6 deletions
|
@ -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"] }
|
||||||
|
|
|
@ -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::*;
|
||||||
|
|
|
@ -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),
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue