Module hooks

Source
Expand description

This module contains bindings to React hooks.

Structs§

DeferredValue
Allows access to the underlying deferred value persisted with use_deferred_value().
Deps
This struct specifies dependencies for certain hooks.
JsRefContainer
Allows access to the underlying JS data persisted with use_js_ref().
Memo
Allows access to the underlying memoized data persisted with use_memo().
RefContainer
Allows access to the underlying data persisted with use_ref().
State
Allows access to the underlying state data persisted with use_state().
Transition
Allows access to the transition state.

Traits§

IntoDestructor
Denotes types that can be used as destructors for effects.

Functions§

use_callback
Returns a memoized callback.
use_context
Allows access to the current context value of the given context.
use_deferred_value
Returns the given value, or in case of urgent updates, returns the previous value given.
use_effect
Runs a function which contains imperative code that may cause side-effects.
use_id
Returns a unique component ID which is stable across server and client.
use_js_ref
This hook can persist JS data through the entire lifetime of the component.
use_layout_effect
Same as use_effect(), but it fires synchronously after all DOM mutations.
use_memo
Returns a persisted, memoized value.
use_ref
This is the main hook for persisting Rust data through the entire lifetime of the component.
use_state
Persist stateful data of the component.
use_transition
Returns a stateful value for the pending state of the transition, and a function to start it.