Refs
Last updated
What is Refs?
Refs provide a way to access DOM nodes or React elements created in the render method.
In the typical React dataflow, props are the only way that parent components interact with their children. To modify a child, you re-render it with new props. However, there are a few cases where you need to imperatively modify a child outside of the typical dataflow. The child to be modified could be an instance of a React component, or it could be a DOM element. For both of these cases, React provides an escape hatch.
Free resources to learn Refs
More in stage 3: Rendering
Refs: common questions
Can I learn Refs in Hindi?
This lesson is written in English. Once you sign in, open it in the interactive course and ask the AI tutor to explain Refs in Hindi or Hinglish. The tutor answers from this lesson’s own text, so it stays on the syllabus, and it runs on your own Google, OpenAI or Anthropic key.
Is this Refs tutorial for beginners?
It is lesson 13 of 79 in the free React roadmap, in stage 3, Rendering. If you are new to React, start from stage 1 and come back here in order; if you already know the earlier stages, this lesson stands on its own.