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
reacthooksdependenciesclean-code
Trim derived/redundant values from effect dependency arrays
Remove dependencies that are derived from other listed dependencies to avoid a bloated array and surprising re-runs.
PR: hegnar-components · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codetsx
| 1 | useEffect(() => { /* ... */ }, [selectedTab, sourceString]); |
| 2 | // sourceString is computed from selectedTab |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | useEffect(() => { /* ... */ }, [selectedTab]); |
Explanation (EN)
Objašnjenje (HR)