React JS Quiz
HomeBlogPrivacy PolicyContact UsTutorialsNewBuy me a coffee

Refs with useRef

  1. 1.What a Ref Is
  2. 2.Reaching into the DOM
  3. 3.Forwarding Refs
  4. 4.Refs in Practice
  5. 🏁 End-of-tutorial quiz
Advertisement
Tutorials/Intermediate/Refs with useRef

Refs with useRef

Hold values that survive renders without causing them, reach into DOM nodes when you must, and forward refs through your own components.

Level
Intermediate
Chapters
4
Exercises
1
Reading time
15 min
Start the tutorial →

What you will cover

  1. 1. What a Ref IsA box React keeps for you, and how it differs from state.
  2. 2. Reaching into the DOMAttaching a ref to an element, and the small number of jobs that justify it.
  3. 3. Forwarding RefsLetting a parent reach the DOM node inside your component.
  4. 4. Refs in PracticeTwo patterns worth keeping, and the mistakes to avoid.
Already know this? Jump to the 7 question quiz →

Up next after this one: Context and Shared State

Advertisement
Advertisement
Support the developer