Open Book

React Refs and How They Work

The React framework conveniently abstracts away a lot of the manual DOM manipulation, so you normally don't need access to the raw DOM elements. But every so often you do. Maybe you need to find the position of a DOM element for instance. For this purpose, React has added a feature to reference DOM elements aptly named Refs. So to…