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
api-designpropscohesionreact
Pass cohesive related parameters as one object
Keep values that belong to the same concept (e.g. ad-targeting keywords) grouped in a single object prop rather than flattening them into many sibling props, keeping call sites scannable and the prop surface small.
PR: hegnar-bellsheep-web · org-mining-2026-06Created: Jun 17, 2026
Bad example
Old codetsx
| 1 | <AdsLayout pageType="x" section="y" contentFormat="z" specialPlacement="w" subsection="v" /> |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | <AdsLayout adParams={{ pageType, section, contentFormat, specialPlacement, subsection }} /> |
Explanation (EN)
Objašnjenje (HR)