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 ruleP1project specificStack: react
reactlayoutdryreuse
Reuse the shared layout to inherit cross-cutting features
Build new pages on the existing shared Layout (passing variations as props/children) so they automatically get ads, A/B tests, and other cross-cutting concerns instead of duplicating a bespoke layout.
PR: frontpage-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codetsx
| 1 | function GamesLayout() { /* bespoke header + structure, no ads/abtest */ } |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | <Layout gaCategory='games'> |
| 2 | <Header home={...} /> |
| 3 | {children} |
| 4 | </Layout> |
Explanation (EN)
Objašnjenje (HR)