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
domidscorrectness
Avoid rendering duplicate element IDs
Rendering the same component (with the same id) twice via show/hide classes produces duplicate DOM IDs; conditionally render one instance instead.
PR: frontpage-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codejsx
| 1 | <Settings className='show-for-large' /> |
| 2 | <Settings className='hide-for-large' /> // same internal id twice |
Explanation (EN)
Objašnjenje (HR)
Good example
New codejsx
| 1 | <BreakpointWrapper from={LARGE}><Settings /></BreakpointWrapper> |
Explanation (EN)
Objašnjenje (HR)