feat: make hooks free-functions

This commit is contained in:
Jonathan Kelley committed 2021-07-27 11:28:05 -04:00
1 parent f782e14211
commit e5c88fe3a4
13 files changed
+373 -323

No files matched your search

+2 -1
View File
@@ -31,7 +31,8 @@ const ENDPOINT: &str = "https://dog.ceo/api/breeds/image/random/";
static App: FC<()> = |cx| {
let state = use_state(cx, || 0);
let dog_node = cx.use_suspense(
let dog_node = use_suspense(
cx,
|| surf::get(ENDPOINT).recv_json::<DogApi>(),
|cx, res| match res {
Ok(res) => rsx!(in cx, img { src: "{res.message}" }),