Rules Hub
Coding Rules Library
← Back to all rules
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
frontend ruleP2stack specificStack: react
reactjsxchildren
Wrap a bare `children` early-return in a fragment
When a component returns its `children` directly, wrap it in a fragment so the return type is a valid React element.
PR: hegnar-bellsheep-web · org-mining-2026-06Created: Jun 17, 2026
Bad example
Old codetsx
| 1 | if (!params) return children; |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | if (!params) return <>{children}</>; |
Explanation (EN)
Objašnjenje (HR)