500: Internal Server Error

Built-in React hooks

The list of built-in React hooks.
Stylized hook

React 16 introduced hooks, a new way of using stateful features in React components. React both has built-in hooks and provides a way to write custom hooks.

The following table summarizes the built-in React hooks:

useStateProvides a way to store and update a stateful value. Updating the value triggers re-rendering.
useEffectUsed to perform side effects. By default, the effect runs after each render.
useLayoutEffectUnlike useEffect, fires synchronously after DOM mutations while re-rendering.
useContextReturns the current value of a React context.
useReducerSimilar to useState, but uses the same signature as Redux reducers.
useMemoReturns a memoized value.
useCallbackReturns a memoized callback.
useRefUsed to store component instance variables.
useImperativeHandleUsed with forwardRef for exposing ref handlers to parent components.
useDebugValueUsed for development/debugging.
Last updated on 4/17/2020 by Anton Vasetenkov.