dioxus/packages/hooks
2022-12-07 13:11:40 -08:00
..
src chore: rename all &cx to cx, make clipppy happy 2022-12-07 13:11:40 -08:00
Cargo.toml optimizations for wasm size (#582) 2022-11-16 22:22:13 -08:00
CHANGELOG.md feat: add changelogs 2022-01-29 10:17:14 -05:00
README.md chore: rename all &cx to cx, make clipppy happy 2022-12-07 13:11:40 -08: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();