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
reactclean-codereadabilitycomponents
Use an implicit-return arrow for purely presentational components
A component with no hooks or logic — just JSX from props — reads more cleanly as a concise arrow with an implicit return than a function body with an explicit return.
PR: hegnar-forum-web · org-mining-3rd-2026-06Created: Jun 18, 2026
Bad example
Old codetsx
| 1 | const TickerChip: React.FC<TickerChipProps> = ({ fullname }) => { |
| 2 | return ( |
| 3 | <a href={`/ticker/${fullname}`}>{fullname}</a> |
| 4 | ); |
| 5 | }; |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | const TickerChip: React.FC<TickerChipProps> = ({ fullname }) => ( |
| 2 | <a href={`/ticker/${fullname}`}>{fullname}</a> |
| 3 | ); |
Explanation (EN)
Objašnjenje (HR)