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
reactrenderingconditional
Skip rendering a container entirely when it would be empty
If a wrapper element will have no visible content under some condition, guard the whole element with that condition instead of rendering an empty box.
PR: vinify-frontend · org-mining-2026-06Created: Jun 17, 2026
Bad example
Old codetsx
| 1 | <Box> |
| 2 | {hasContent && <Content />} |
| 3 | </Box> |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | {hasContent && ( |
| 2 | <Box> |
| 3 | <Content /> |
| 4 | </Box> |
| 5 | )} |
Explanation (EN)
Objašnjenje (HR)