escape hatch
A feature that lets you step outside the normal React model, such as refs and Effects, for the cases React cannot express declaratively.
In more detail
Escape hatches are needed to focus an input, measure an element or talk to a non-React library. Most application logic should not rely on them.
Related terms
- ref — A React handle that points at a real DOM element, so code can focus it, measure it or attach listeners.
- useEffect — The React hook for running side work, such as adding listeners or changing document.body, after a component renders.
- declarative programming — A style of programming where you describe the result you want and let the system work out the steps, rather than giving each step yourself.
Taught in
- useRef Mechanics: DOM References And Mutable Persistent State — React 19 & Modern Component Architecture