feat: make hooks free-functions
This commit is contained in:
1 parent
f782e14211
commit
e5c88fe3a4
13 files changed
+373
-323
No files matched your search
@@ -21,7 +21,7 @@ const App: FC<()> = |cx| {
|
||||
};
|
||||
|
||||
const Task: FC<()> = |cx| {
|
||||
let (task, res) = cx.use_task(|| async { true });
|
||||
let (task, res) = use_task(cx, || async { true });
|
||||
// task.pause();
|
||||
// task.restart();
|
||||
// task.stop();
|
||||
@@ -29,7 +29,7 @@ const Task: FC<()> = |cx| {
|
||||
|
||||
//
|
||||
|
||||
let _s = cx.use_task(|| async { "hello world".to_string() });
|
||||
let _s = use_task(cx, || async { "hello world".to_string() });
|
||||
|
||||
todo!()
|
||||
};
|
||||
|
||||
@@ -4,7 +4,8 @@ use dioxus_core::prelude::*;
|
||||
|
||||
fn App(cx: Context<()>) -> DomTree {
|
||||
//
|
||||
let vak = cx.use_suspense(
|
||||
let vak = use_suspense(
|
||||
cx,
|
||||
|| async {},
|
||||
|c, res| {
|
||||
//
|
||||
|
||||
Reference in new issue
Block a user