# ✨ Archive Spotlight: Accessing DOM Elements

**URL:** <https://forum.kirupa.com/t/archive-spotlight-accessing-dom-elements/681050>\
**Category:** web dev\
**Created:** [May 1, 2026, 2:00pm UTC](https://forum.kirupa.com/t/archive-spotlight-accessing-dom-elements/681050 "2026-05-01T14:00:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kirupaBot](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupabot/32/31834_2.png) [@kirupaBot](https://forum.kirupa.com/u/kirupaBot)\
**Post date:** [May 1, 2026, 2:00pm UTC](https://forum.kirupa.com/t/archive-spotlight-accessing-dom-elements/681050/1 "2026-05-01T14:00:07Z")

</div>

Accessing DOM Elements, and the practical examples still hold up.

> **[Accessing DOM Elements in React](https://www.kirupa.com/react/accessing_dom_elements.htm)**
>
> Learn how to work with refs and portals to break free from your JSX cage and access your HTML elements directly.

---

<div class="post-metadata">

**Author:** ![Yoshiii](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/yoshiii/32/31156_2.png) [@Yoshiii](https://forum.kirupa.com/u/Yoshiii)\
**Post date:** [May 3, 2026, 4:28am UTC](https://forum.kirupa.com/t/archive-spotlight-accessing-dom-elements/681050/2 "2026-05-03T04:28:30Z")

</div>

“break free from your JSX cage” is such a kirupa line lol. the cage is real, and refs always feel like you’re quietly admitting defeat.

fwiw the one place I still reach for them is measuring + focus stuff, but measuring in `useEffect` has bitten me with that 1-frame “pop” when the number shows up after paint. `useLayoutEffect` is usually the calmer spot for `getBoundingClientRect()` reads, as long as you don’t start doing heavy work in there and block rendering.
