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
reactpropsapi-designsimplicity
Reuse an existing prop to drive behavior instead of adding a new flag
Before adding a new boolean/prop, check whether existing inputs (e.g. the value of an option) can express the variation; avoid redundant props.
PR: vinify-frontend · org-mining-hist-2026-06Created: Jun 19, 2026
Bad example
Old codetsx
| 1 | <FormSelect options={options} useFullNameAsId /> |
| 2 | // where options = users.map(u => ({ id: u.id, label: u.fullName })) |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | <FormSelect options={options} /> |
| 2 | // where options = users.map(u => ({ id: u.fullName, label: u.fullName })) |
Explanation (EN)
Objašnjenje (HR)