computer-scienceangular-roadmapbackend-roadmapblockchain-roadmapdba-roadmapdeveloper-roadmapdevops-roadmapfrontend-roadmapgo-roadmaphactoberfestjava-roadmapjavascript-roadmapnodejs-roadmappython-roadmapqa-roadmapreact-roadmaproadmapstudy-planvue-roadmapweb3-roadmap
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
9 lines
849 B
9 lines
849 B
# 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. |
|
|
|
<ResourceGroupTitle>Free Content</ResourceGroupTitle> |
|
<BadgeLink colorScheme='blue' badgeText='Official Docs' href='https://reactjs.org/docs/refs-and-the-dom.html'>Refs and DOM</BadgeLink> |
|
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://www.robinwieruch.de/react-ref/'>Examples of using refs in React</BadgeLink>
|
|
|