dioxus/packages/hooks
Jonathan Kelley 13cf95a9ea
Merge pull request #178 from autarch/autarch/spelling-fix
Fix misspelled variable name in usestate.rs
2022-01-30 13:13:04 -05:00
..
src Fix typo in comment in use_shared_state.rs 2022-01-29 10:43:10 -06:00
Cargo.toml Release dioxus-core v0.1.9 2022-01-29 10:42:38 -05: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();