dioxus/packages/hooks
2022-06-30 16:35:33 -04:00
..
src fix: make clippy happier with rust 1.63 2022-06-30 16:35:33 -04:00
Cargo.toml Release dioxus-core v0.2.1, dioxus-core-macro v0.2.1, dioxus-html v0.2.1, dioxus-interpreter-js v0.2.1, dioxus-desktop v0.2.3, dioxus-hooks v0.2.1, dioxus-liveview v0.1.0, dioxus-native-core v0.2.0, dioxus-native-core-macro v0.2.0, dioxus-router v0.2.3, dioxus-ssr v0.2.1, dioxus-tui v0.2.2, dioxus-web v0.2.1, fermi v0.2.1, dioxus v0.2.4 2022-05-02 23:57:20 -04:00
CHANGELOG.md feat: add changelogs 2022-01-29 10:17:14 -05:00
README.md wip: polish some more things 2021-12-29 21:28:28 -05:00

Common hooks for Dioxus

This crate includes some basic useful hooks for dioxus:

  • use_state
  • use_ref
  • use_future
  • use_coroutine

use_state

The primary mechanism of stored state.

You can always use it "normally" with the split method:

// Rusty-smart-pointer usage:
let value = use_state(&cx, || 10);

// "Classic" usage:
let (value, set_value) = use_state(&cx, || 0).split();