Skip to content
This repository was archived by the owner on Jul 31, 2026. It is now read-only.

fix(Button): fixes behavior of asChild in BrandButton - #325

Merged
qstearns merged 1 commit into
mainfrom
quinn/fix-brand-button-as-child
Dec 19, 2025
Merged

fix(Button): fixes behavior of asChild in BrandButton#325
qstearns merged 1 commit into
mainfrom
quinn/fix-brand-button-as-child

Conversation

@qstearns

@qstearns qstearns commented Dec 19, 2025

Copy link
Copy Markdown
Collaborator

mouse moves trigger render cycles in BrandButtons.

when this component reference is unstable it breaks click events unpredictably


Note

Extracts a top-level BrandSlot and passes isBrandVariant when asChild is used to correctly inject brand background without unstable re-renders.

  • Button (src/components/Button/index.tsx):
    • Refactor/Extraction: Move BrandSlot to a top-level component and reuse it when asChild is true.
    • asChild Handling: Pass isBrandVariant to BrandSlot and set Comp to BrandSlot when asChild to inject the brand background correctly.
    • Rendering: Keep existing brand background span for non-asChild path; child processing unchanged except bypassed when asChild.

Written by Cursor Bugbot for commit b9b4191. This will update automatically on new commits. Configure here.

@qstearns
qstearns requested a review from adaam2 December 19, 2025 18:20
@qstearns

Copy link
Copy Markdown
Collaborator Author

Oh hang on. This is not good typescript

mouse moves trigger render cycles in BrandButtons.

When this component reference is unstable breaks click events unpredictably
@qstearns
qstearns force-pushed the quinn/fix-brand-button-as-child branch from d4773e3 to b9b4191 Compare December 19, 2025 18:24
@qstearns
qstearns merged commit 3bf8d57 into main Dec 19, 2025
9 of 10 checks passed
@qstearns
qstearns deleted the quinn/fix-brand-button-as-child branch December 19, 2025 18:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants