Skip to content

Frontend React

yibinericxia edited this page Aug 11, 2023 · 1 revision

Common Hooks

State Hook

useState() is very helpful for us to create state variables and update them

Effect Hook

useEffect() is commonly used when we want to make an HTTP request

Layout Effect Hook

useLayoutEffect() is called before useEffect()

Reference Hook

useRef() can help when we want to interact with an element, such as to clear the value of input or focus it

Reducer Hook

Similar to useState(), useReducer() is helpful for managing state across multiple components that may involve different actions

References:

Clone this wiki locally