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
reactcontextcohesionstate-management
Place feature state in its own feature context
State that belongs to a specific feature should live in that feature's context/provider, not be wedged into an unrelated page-level context.
PR: hegnar-forum-web · org-mining-3rd-2026-06Created: Jun 18, 2026
Bad example
Old codets
| 1 | // in generic TickerPageContext |
| 2 | useEffect(() => { setPinpointAccessLevel(level); }, [level]); |
Explanation (EN)
Objašnjenje (HR)
Good example
New codets
| 1 | // in PinpointContext, alongside other pinpoint state |
| 2 | useEffect(() => { setPinpointAccessLevel(level); }, [level]); |
Explanation (EN)
Objašnjenje (HR)