Skip to main content
Version: 0.21

State

General view of how to store state

This table can be used as a guide when deciding what state-storing type fits best for your use case:

HookTypeRerender when?Scope
use_stateTgot setcomponent instance
use_state_eqT: PartialEqgot set with diff. valuecomponent instance
use_reducerT: Reduciblegot reducedcomponent instance
use_reducer_eqT: Reducible + PartialEqgot reduced with diff. valuecomponent instance
use_memoDeps -> Tdependencies changedcomponent instance
use_callbackDeps -> Callback<E>dependencies changedcomponent instance
use_mut_refT-component instance
a static global variableT-global, used by all