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 ruleP1stack specificStack: TypeScript
typescriptreactpropscorrectness
Omit props from a spread type that would override explicit handlers
When spreading a props type that includes onClick (or similar) onto an element that already wires that handler, Omit it from the spread type to prevent silent overrides.
PR: vinify-frontend · org-mining-hist-2026-06Created: Jun 19, 2026
Bad example
Old codets
| 1 | interface Props { ConfirmBtnProps?: ButtonProps; } // onClick could override onConfirm |
Explanation (EN)
Objašnjenje (HR)
Good example
New codets
| 1 | interface Props { ConfirmBtnProps?: Omit<ButtonProps, 'onClick'>; } |
Explanation (EN)
Objašnjenje (HR)