React hook

A function whose name starts with use, such as useState or useEffect, that lets a React component keep state or run side work.

In more detail

Hooks can only be called at the top level of a component or of another hook. Headless libraries package behaviour as custom hooks, such as a useFocusTrap that returns what a dialog needs.

Related terms

Taught in

References