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
stylingdefaultsreadability
Use explicit default values instead of empty strings for style props
When conditionally setting a style prop, pass the real default value rather than an empty string so the prop is meaningful.
PR: hegnar-forum-web · org-mining-hist-2026-06Created: Jun 20, 2026
Bad example
Old codetypescript
| 1 | <Grid container alignItems={isMobile ? '' : 'center'}> |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | <Grid container alignItems={isMobile ? 'normal' : 'center'}> |
Explanation (EN)
Objašnjenje (HR)