useState
Returns a stateful value, and a function to update it.
useEffect
Accepts a function that contains imperative, possibly effectful code.
useContext
Accepts a context object (the value returned from React.createContext
) and returns the current context value, as given by the nearest context provider for the given context.
useReducer
Accepts a reducer of type (state, action) => newState
, and returns the current state paired with a dispatch method. (If you’re familiar with Redux, you already know how this works.)
useCallback
Returns a memoized callback.
useMemo
Returns a memoized value.
useRef
Returns a mutable ref object whose .current
property is initialized to the passed argument (initialValue
).
The returned object will persist for the full lifetime of the component.
useImperativeHandle
Customizes the instance value that is exposed to parent components when using ref
.
useLayoutEffect
The signature is identical to useEffect
, but it fires synchronously after all DOM mutations.
useDebugValue
Can be used to display a label for custom hooks in React DevTools.