--- id: wiki-2026-0508-fragment-bound title: Fragment-bound category: 10_Wiki/Topics status: verified canonical_id: self aliases: [React Fragment, Fragment-bound Component, Multi-root Component] duplicate_of: none source_trust_level: A confidence_score: 0.9 verification_status: applied tags: [react, frontend, jsx, dom] raw_sources: [] last_reinforced: 2026-05-10 github_commit: pending tech_stack: language: typescript framework: react --- # Fragment-bound ## 매 한 줄 > **"매 component 의 root 의 wrapper div 의 elimination"**. React Fragment (`<>...` 또는 ``) 매 component 매 multiple sibling roots 의 return 의 enable — 매 unnecessary `
` wrapper 의 avoid. "Fragment-bound" component 매 single DOM root 의 not-have, 매 layout (Grid, Table, Flex) 매 fragile 의 implication 의 carry. ## 매 핵심 ### 매 Why Fragment - **DOM cleanliness**: 매 wrapper div 의 CSS Grid/Flex 의 break — 매 child 매 grid item 의 directly 의 must be. - **No semantic noise**: 매 `` 매 `` 매 ``). 2. Grid items in CSS Grid layout. 3. Component library — wrapper-less primitives. 4. Conditional sibling rendering. ## 💻 패턴 ### Basic Fragment ```tsx function Greeting() { return ( <>

Hello

World

); } // 매 DOM 의

+

의 sibling, 매 no wrapper ``` ### Fragment with key (list) ```tsx import { Fragment } from 'react'; function Glossary({ items }: { items: { term: string; def: string }[] }) { return (

{items.map(it => (
{it.term}
{it.def}
))}
); } // 매 short syntax 매 key prop 의 not-accept — 매 explicit Fragment 의 use ``` ### Table row composition ```tsx function ProductRow({ product }: { product: Product }) { return ( <>

); } function ProductTable({ products }: { products: Product[] }) { return (
` 의 nest 의 wrapper div 의 invalid HTML. - **Performance (marginal)**: 매 fewer DOM nodes — 매 hot lists 의 measurable. ### 매 Forms - `<>` — short syntax, 매 no key/props. - `` — 매 list iteration 매 key 의 needed 시. - `` — explicit import, 매 build tooling 의 short syntax 의 not-support 시. ### 매 Fragment-bound implications - 매 ref 의 attach 의 not-possible (매 single DOM node 의 not-have). - 매 parent 매 child layout 의 control 의 must — 매 child 매 own root 의 not-have. - 매 portals 매 separate concern. ### 매 응용 1. Table rows / cells (`` returning `...... {product.name} {product.price} {product.stock}
{products.map(p => ( ))}
); } // 매 wrapper div 매 tr 안 의 invalid HTML — 매 Fragment 의 only correct ``` ### CSS Grid items ```tsx function GridGroup() { return ( <>
A
B
C
); } function Layout() { return (
{/* 매 3 children 의 grid items 의 directly */}
); } // 매 wrapper div 의 add 시 매 single grid cell 의 collapse ``` ### Conditional sibling rendering ```tsx function Notification({ user }: { user?: User }) { if (!user) return null; return ( <> {user.unreadCount > 0 && ( {user.unreadCount} )} {user.name} ); } ``` ### Ref forwarding 매 NOT possible ```tsx // 매 X — Fragment 매 ref 의 not-attach 의 const Bad = forwardRef((props, ref) => ( <>

Title

{/* 매 child element 의 ref 의 forward 의 must */}

Body

)); // 매 O — 매 explicit child 의 ref 의 forward const Card = forwardRef( ({ title, body }, ref) => ( <>

{title}

{body}

), ); ``` ### Suspense / ErrorBoundary 매 Fragment children ```tsx function App() { return ( }> <>