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
namingreacteventsprops
Name event handlers handleX and their props onX
Prefix internal event handlers with handle and the props that receive them with on, so naming is consistent across the codebase.
PR: hegnar-forum-web · org-mining-hist-2026-06Created: Jun 20, 2026
Bad example
Old codetsx
| 1 | const discardPost = () => { ... }; |
| 2 | <DiscardPost discard={discardPost} /> |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | const handleDiscardPost = () => { ... }; |
| 2 | <DiscardPost onDiscardPost={handleDiscardPost} /> |
Explanation (EN)
Objašnjenje (HR)