--- title: "React Fragment Refs: Attach Behavior Without the Wrapper Div" author: "Danny Holloran" published: "2026-10-20T10:11:22.180Z" updated: "2026-10-20T10:11:22.180Z" url: "https://zyvop.com/react-fragment-refs-attach-behavior-without-the-wrapper-div-eho9z" canonical: "https://danholloran.me/posts/react-fragment-refs-attach-behavior-without-a-wrapper-div" tags: ["react.js","Accessibility","react","JavaScript"] --- # React Fragment Refs: Attach Behavior Without the Wrapper Div ![Cover image]() Every React codebase has at least one of these: a `
` that exists for no reason except to hold a ref. Maybe it wraps a list so an `IntersectionObserver` has something to watch. Maybe it wraps a group of form fields so you can focus the first one. It works, right up until it breaks a flex layout, adds a stray grid item, or lands inside a `