You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Inabillity to return many children or elements without a single parent/div #8765
You can return sibling elements without adding a wrapper to the DOM. Use a Fragment:
functionGreeting(){return(<><h1>Hello</h1><p>Welcome to React.</p></>);}
React receives a single JSX expression, and the browser gets the heading and paragraph as siblings. There is no extra div to affect layout. The docs show this under Return a single root element.
Activity
pwnjoshi commentedon Nov 27, 2026
You can return sibling elements without adding a wrapper to the DOM. Use a Fragment:
React receives a single JSX expression, and the browser gets the heading and paragraph as siblings. There is no extra
divto affect layout. The docs show this under Return a single root element.