mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-10 14:44:12 +00:00
f2c1c05792
The to_owned macro is helpful to handle hooks with async components, but when using properties it can be problematic because `cx` will be moved in the async block, and will result in a compilation error. This adds a new helper that allows to make either hooks or properties owned. |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
CHANGELOG.md | ||
README.md |
Dioxus Hooks
Website | Guides | API Docs | Chat
Overview
dioxus-hooks
includes some basic useful hooks for dioxus:
- use_state
- use_ref
- use_future
- use_coroutine
- use_callback
Unlike React, none of these hooks are foundational since they all build off the primitive cx.use_hook
.
This crate also provides a few helpful macros to get around some Rust lifetime management issues in async.
to_owned![]
use_future!()
use_callback!()
Contributing
- Report issues on our issue tracker.
- Join the discord and ask questions!
License
This project is licensed under the MIT license.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Dioxus by you shall be licensed as MIT without any additional terms or conditions.