Jonathan Kelley 0bf4725639 fix: namespacing of dynamic attributes 2 年之前
..
src 0bf4725639 fix: namespacing of dynamic attributes 2 年之前
CHANGELOG.md 56f3002aed feat: add changelogs 3 年之前
Cargo.toml f21c8423eb optimizations for wasm size (#582) 2 年之前
README.md 4eefc3f854 chore: rename all &cx to cx, make clipppy happy 2 年之前

README.md

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();