dioxus/packages/hooks
2022-01-28 16:12:06 -05:00
..
src fix: use_state 2022-01-28 16:12:06 -05:00
Cargo.toml Release dioxus-core v0.1.7, dioxus-core-macro v0.1.6, dioxus-html v0.1.4, dioxus-desktop v0.1.5, dioxus-hooks v0.1.6, dioxus-mobile v0.0.3, dioxus-router v0.1.0, dioxus-ssr v0.1.2, dioxus-web v0.0.4, dioxus v0.1.7 2022-01-08 02:25:03 -05:00
CHANGELOG.md Release dioxus-hooks v0.1.6, dioxus-mobile v0.0.3, dioxus-router v0.1.0, dioxus-ssr v0.1.2, dioxus-web v0.0.4, dioxus v0.1.7 2022-01-08 02:30:37 -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();