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 ruleP2stack specificStack: react
reactmemoperformancererender
Memoize components that must not re-render on unrelated state changes
Wrap a component in memo when an unrelated parent state update (e.g. opening an image preview) would otherwise re-render and reset its expensive content.
PR: hegnar-forum-web · org-mining-2026-06Created: Jun 17, 2026
Bad example
Old codetsx
| 1 | export default PostBody; |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | export default memo(PostBody); |
Explanation (EN)
Objašnjenje (HR)