fix: use arcwake instead of rcwake
This commit is contained in:
1 parent
651ab3e7e3
commit
2fa3fe1fc0
16 files changed
+326
-79
No files matched your search
@@ -0,0 +1,50 @@
|
||||
use dioxus::prelude::*;
|
||||
use futures_util::Future;
|
||||
|
||||
#[test]
|
||||
fn catches_panic() {
|
||||
let mut dom = VirtualDom::new(app);
|
||||
|
||||
let a = dom.rebuild();
|
||||
}
|
||||
|
||||
fn app(cx: Scope) -> Element {
|
||||
cx.render(rsx! {
|
||||
div {
|
||||
PanicChild {}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
fn PanicChild(cx: Scope) -> Element {
|
||||
panic!("Rendering panicked for whatever reason");
|
||||
|
||||
cx.render(rsx! {
|
||||
h1 { "It works!" }
|
||||
})
|
||||
}
|
||||
|
||||
fn ThrowChild(cx: Scope) -> Element {
|
||||
cx.throw(std::io::Error::new(std::io::ErrorKind::AddrInUse, "asd"))?;
|
||||
|
||||
let g: i32 = "123123".parse().throw(cx)?;
|
||||
|
||||
cx.render(rsx! {
|
||||
div {}
|
||||
})
|
||||
}
|
||||
|
||||
fn custom_allocator(cx: Scope) -> Element {
|
||||
let g = String::new();
|
||||
|
||||
let p = g.as_str();
|
||||
|
||||
let g2 = cx.use_hook(|| 123);
|
||||
// cx.spawn(async move {
|
||||
|
||||
// //
|
||||
// // println!("Thig is {p}");
|
||||
// });
|
||||
|
||||
None
|
||||
}
|
||||
Reference in new issue
Block a user