Ref

/rɛf/ · Noun · Development

Definitions

  1. In React, a mutable container object (created via useRef or createRef) that holds a .current value persisted across renders without triggering re-renders — commonly used to access underlying DOM nodes or store instance-level values like timers and previous props.

    In plain English: A way to grab a direct handle to something in a React app — like a specific input box — so you can interact with it directly when needed.

    Example: "I attached a ref to the input element so I could call .focus() imperatively after the modal opens."

Related Terms