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
error-handlinguxfallbackresilience
Provide a meaningful, context-appropriate fallback error screen
Don't reuse a data-heavy component (e.g. a profile with tables) as an error fallback. Render a generic error screen that still signals context, and don't rely solely on per-section error handling.
PR: hegnar-bellsheep-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codetsx
| 1 | errorElement={<PersonProfile />} // renders tables that have no data |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | errorElement={<ProfileErrorScreen />} // icon + message, signals you're on a profile |
Explanation (EN)
Objašnjenje (HR)