DEV Community 👩‍💻👨‍💻

Discussion on: Using refs in React.js

Collapse
 
amoled27 profile image
Amod Shinde Author

Thanks, totally agree with you. I just gave a sort of demo on how refs work. In simple words:
There are controlled and uncontrolled components in React. Libraries or external files which we may use in React come under uncontrolled components.
As the name says, we dont have a control over it via React app, hence we cant use traditional document.getElement queries to manipulate DOM.
Thus, react refs come into the picture to access and manipulate these uncontrolled components.