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
analyticstrackingredundancy
Omit a tracking action that the parent already provides, or it serializes as undefined
Don't add an empty/duplicate analytics action on a child when the parent already supplies one; an unset action on the child can render as 'undefined' instead of inheriting.
PR: frontpage-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codejsx
| 1 | <Parent data-ga-action='click'> |
| 2 | <Button data-ga-action={undefined} /> // emits ga action=undefined |
| 3 | </Parent> |
Explanation (EN)
Objašnjenje (HR)
Good example
New codejsx
| 1 | <Parent data-ga-action='click'> |
| 2 | <Button /> // inherit action label from parent |
| 3 | </Parent> |
Explanation (EN)
Objašnjenje (HR)