Skip to content

feat(link): add tracking props to links#120307

Draft
TkDodo wants to merge 1 commit into
masterfrom
tkdodo/feat/add-analytics-props-to-link
Draft

feat(link): add tracking props to links#120307
TkDodo wants to merge 1 commit into
masterfrom
tkdodo/feat/add-analytics-props-to-link

Conversation

@TkDodo

@TkDodo TkDodo commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@TkDodo

TkDodo commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator Author

bugbot run

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jul 22, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit bdcd791. Configure here.

shapeVariant: _shapeVariant,
...props
}: LinkButtonProps & {shapeVariant: 'rectangular' | 'square'}) => {
const {handleClick} = useClickTracking(props);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LinkButton tracking props filtered

High Severity

useClickTracking now runs inside StyledLinkButton, after shouldForwardProp drops non-DOM props via isPropValid. That strips analyticsEventKey, analyticsEventName, analyticsParams, busy, and variant, so custom LinkButton analytics never fire and busy clicks are no longer blocked. Previously these were read outside the styled component. Existing callers such as the resolve setup LinkButton lose their event keys.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit bdcd791. Configure here.

}

return <Component {...behavior()} />;
return <Component {...propsWithBehavior} onClick={handleClick} />;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Analytics props leak to DOM

Medium Severity

Link spreads propsWithBehavior onto the underlying router/a component, including the new analyticsEventKey, analyticsEventName, and analyticsParams. Those are not valid DOM attributes, so React warns and analyticsParams (an object) is especially problematic on the anchor element.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit bdcd791. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant