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 ruleP1stack specificStack: react
reactjsxcorrectnessduplication
Do not render the same component twice unintentionally
Avoid leaving a duplicate render of the same component (e.g. a dialog) both inside and outside a conditional block.
PR: hegnar-forum-web · org-mining-hist-2026-06Created: Jun 20, 2026
Bad example
Old codetypescript
| 1 | {!deletedAt && ( |
| 2 | <> |
| 3 | <DeleteDialog open={open} /> |
| 4 | </> |
| 5 | )} |
| 6 | <DeleteDialog open={open} /> |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | {!deletedAt && <DeleteDialog open={open} />} |
Explanation (EN)
Objašnjenje (HR)