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 ruleP2project specificStack: react
reactimagesperformancereuse
Use the shared responsive Image component for images
Render images through the project's Image component (retina detection, per-breakpoint sizes) instead of raw background-image or img tags.
PR: frontpage-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codetypescript
| 1 | <div style={{ backgroundImage: `url(${item.image.url})` }} /> |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | <Image src={item.image.url} sizes={{ small, medium, large }} /> |
Explanation (EN)
Objašnjenje (HR)