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
reactcomponent-designreusabilitystyling
Make components customizable via a classes prop, not single-purpose boolean flags
Let callers override styling through a classes object prop instead of adding one-off boolean props like isForum.
PR: hegnar-forum-web · org-mining-hist-2026-06Created: Jun 20, 2026
Bad example
Old codetsx
| 1 | type Props = { isForum?: boolean }; |
| 2 | <Fallback isForum /> |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | type Props = { classes?: { container?: string } }; |
| 2 | <Fallback classes={{ container: styles.fallbackContainer }} /> |
Explanation (EN)
Objašnjenje (HR)