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 ruleP1universalStack: react
accessibilityhtmlsemanticsreact
Never nest an interactive element inside a button
A <button> may not contain another button (or other interactive control); use role="button" on a div, or restructure, to keep valid and accessible markup.
PR: hegnar-journalist-boost · org-mining-2026-06Created: Jun 17, 2026
Bad example
Old codetsx
| 1 | <button onClick={selectRow}> |
| 2 | <button onClick={remove}>x</button> |
| 3 | </button> |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | <div role="button" tabIndex={0} onClick={selectRow}> |
| 2 | <button onClick={remove}>x</button> |
| 3 | </div> |
Explanation (EN)
Objašnjenje (HR)