jsx-fragments
Configuration
rslint.config.ts
Enforce shorthand or standard form for React fragments.
Rule Details
In JSX, a React fragment can be written as either
<React.Fragment>...</React.Fragment> or as shorthand <>...</>.
Examples of incorrect code for this rule in the default syntax mode:
Examples of correct code for this rule in the default syntax mode:
Rule Options
The first option is "syntax" (default) or "element".
Examples of incorrect code for this rule with "element":
Examples of correct code for this rule with "element":
Support for fragments was added in React v16.2, so the rule reports either form when an older React version is specified in shared settings.