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
muicomponentsiconsreuse
Use a component's icon props instead of hand-rolled markup
When a UI component exposes startIcon/endIcon (or similar) props, use them to render icons rather than reproducing icon-and-label layout manually.
PR: hegnar-forum-web · org-mining-hist-2026-06Created: Jun 20, 2026
Bad example
Old codetsx
| 1 | <Button> |
| 2 | <ReplyIcon /> |
| 3 | <span>Reply</span> |
| 4 | </Button> |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | <Button startIcon={<ReplyIcon />}>Reply</Button> |
Explanation (EN)
Objašnjenje (HR)