ref

A React handle that points at a real DOM element, so code can focus it, measure it or attach listeners.

In more detail

Consumers often pass a ref to a design system component and expect it to reach the underlying element. When a component also needs its own ref to that element, a helper such as composeRefs combines both so each receives the node.

Example

<input ref={inputRef} />

Related terms

Taught in

References