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
muithemedefaultsdry
Set repeated component defaults centrally in the theme, not per usage
Configure default props (placement, variant) for a UI-library component once in the theme rather than repeating the same prop at every call site.
PR: hegnar-forum-web · org-mining-hist-2026-06Created: Jun 20, 2026
Bad example
Old codejsx
| 1 | <Tooltip placement="top" /> |
| 2 | <Tooltip placement="top" /> // repeated everywhere |
Explanation (EN)
Objašnjenje (HR)
Good example
New codejavascript
| 1 | // theme |
| 2 | components: { MuiTooltip: { defaultProps: { placement: 'top' } } } |
Explanation (EN)
Objašnjenje (HR)