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 ruleP2universalStack: react
reacticonssvgreuse
Define SVG icons as reusable components, not inline SVG in helpers
Place icons as standard FC<SVGProps> components in the icons folder with size/color passthrough rather than hardcoding inline SVG.
PR: vinify-frontend · org-mining-deep-2026-06Created: Jun 17, 2026
Bad example
Old codetsx
| 1 | // inside a helpers file |
| 2 | const IgnoreColumnIcon = () => <svg width="16" height="16">...</svg>; |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | // components/SvgIcons/IgnoreColumnIcon.tsx |
| 2 | const IgnoreColumnIcon: FC<SVGProps<SVGSVGElement>> = (props) => ( |
| 3 | <svg {...props}>...</svg> |
| 4 | ); |
Explanation (EN)
Objašnjenje (HR)