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
reacthocpropsreusability
Configure a HOC through the wrapped component's props, not a second factory argument
Instead of baking config into a HOC factory's second parameter, read it from props so the HOC stays generic and relocatable to a shared module.
PR: frontpage-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codejsx
| 1 | WithNativeAd(Article, { adPlacement: 'ad-native-nettguide' }); |
Explanation (EN)
Objašnjenje (HR)
Good example
New codejsx
| 1 | // HOC reads this.props.adPlacement |
| 2 | <NativeAdArticle adPlacement="ad-native-nettguide" /> |
Explanation (EN)
Objašnjenje (HR)