August 16, 2018 09:09 pm GMT
Original Link: https://css-tricks.com/working-with-refs-in-react/
Working with refs in React
Refs make it possible to access DOM nodes directly within React. This comes in handy in situations where, just as one example, you want to change the child of a component. Lets say you want to change the value of an <input>
element, but without using props or re-rendering the whole component.
Thats the sort of thing refs are good for and what well be digging into in this post.
How to create a ref
createRef()
is a new API …
The post Working with refs in React appeared first on CSS-Tricks.
Original Link: https://css-tricks.com/working-with-refs-in-react/
Share this article:
Tweet
View Full Article