website/versioned_docs/version-0.20/concepts/function-components/hooks/introduction.mdx
Hooks are functions that let you store state and perform side-effects.
Yew comes with a few pre-defined Hooks. You can also create your own or discover many community made hooks.
use_if expression inside a function / hook.match expression inside a function / hook.These rules are enforced by either compile time or run-time errors.
Yew comes with the following predefined Hooks:
use_stateuse_state_equse_memouse_callbackuse_mut_refuse_node_refuse_reduceruse_reducer_equse_effectuse_effect_with_depsuse_contextuse_force_updateThe documentation for these hooks can be found in the Yew API docs
There are cases where you want to define your own Hooks to encapsulate potentially stateful logic from a component into reusable functions. See the Defining custom hooks section for more information.