Complete useRef Summary in 2 minutes

Опубликовано: 18 Май 2026
на канале: UI Engineering
493
42

React useRef hook summarized in 2 minutes. Covering API, real use cases and basic mistakes.
It should be enough to get you started!

⏱️ Timestamps:
00:00 - Introduction
00:24 - Persisting values in Refs
01:19 - Persisting DOM nodes in Refs

📖 Concepts:
How to use the useRef hook
What refs are used for
Common mistake when persisting values in refs
Why refs are useful if we already can persist variables in state
Accessing and setting ref's value
JavaScript DOM selectors vs Ref API
Passing refs to built-in HTML elements
Common error with ref forwarding
Passing refs to Custom Functional Components
Custom Ref Prop Pattern
forwardRef API

Icons: http://www.flaticon.com/
#reactjs