Fragment
A no-op wrapper: returns props.children untouched, so the children are created by the caller's getter exactly as if no wrapper existed.
A no-op wrapper: returns props.children untouched, so the children are created by the caller's
getter exactly as if no wrapper existed. Use it to group several children under one element.
Import#
ts
import { Fragment } from "@shadow-js/web";
Signature#
ts
function Fragment(props: FragmentProps): unknown
Parameters#
| Name | Description |
|---|---|
props |
The children to group. |
Returns#
props.children, unchanged.
Examples#
ts
import { Fragment } from "@shadow-js/web";
function Header() {
return <h1>Title</h1>;
}
function Page() {
return (
<Fragment>
<Header />
<p>Body</p>
</Fragment>
);
}