For AI agents: the complete documentation index is available at /zh/llms.txt, the full documentation bundle is available at /zh/llms-full.txt, and this page is available as Markdown at /zh/api/react.fragment.md.
这是开发预览网站。请访问正式文档 lynx-stack.dev

Home > @lynx-js/react > Fragment

Fragment variable

Lets you group elements without a wrapper node.

Signature:

Fragment: typeof import('react').Fragment

Example 1

import { Fragment } from '@lynx-js/react';

<Fragment>
  <text>Hello</text>
  <text>World</text>
</Fragment>

Example 2

// Using the <></> shorthand syntax:

<>
  <text>Hello</text>
  <text>World</text>
</>