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
reacthydrationresponsive
Toggle desktop/mobile variants with CSS, not a JS isMobile branch
For purely presentational variants, render both and show/hide via CSS to avoid a post-mount hydration flash.
PR: hegnar-forum-web · org-mining-deep-2026-06Created: Jun 17, 2026
Bad example
Old codetsx
| 1 | {isMobile ? <MobileTable/> : <DesktopTable/>} // flashes after mount |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | <DesktopTable className={styles.desktopOnly}/> |
| 2 | <MobileTable className={styles.mobileOnly}/> |
Explanation (EN)
Objašnjenje (HR)