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
reactforwardrefsimplicitycomponents
Use forwardRef only on components that actually need a ref
Don't blanket-apply forwardRef to every component. Keep it on the one component that needs a forwarded ref and simplify the rest.
PR: hegnar-bellsheep-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codetsx
| 1 | const TableBody = React.forwardRef((p, ref) => <tbody ref={ref} {...p} />); // ref never used |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | const TableBody = 'tbody'; |
Explanation (EN)
Objašnjenje (HR)