Jonathan Kelley e7505188d6 release: make a new 0.2.0 release of Dioxus %!s(int64=3) %!d(string=hai) anos
..
src 50d509688d feat: update examples for tui %!s(int64=3) %!d(string=hai) anos
CHANGELOG.md 56f3002aed feat: add changelogs %!s(int64=3) %!d(string=hai) anos
Cargo.toml e7505188d6 release: make a new 0.2.0 release of Dioxus %!s(int64=3) %!d(string=hai) anos
README.md 14961023f9 wip: polish some more things %!s(int64=3) %!d(string=hai) anos

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