Skip to content

Conversation

@joshblack
Copy link
Member

Updates our architecture docs for polymorphic components based on our mob pair today 👀

This helps to address a couple of problems:

  • When using the as prop, the base component will not get overriden
  • For sx being applied to nested components, this approach should correctly transform sx into className and pass it along
  • This will also prevent sx from being passed to the wrapped component

Copilot AI review requested due to automatic review settings September 17, 2025 16:39
@joshblack joshblack requested a review from a team as a code owner September 17, 2025 16:39
@joshblack joshblack requested a review from TylerJDev September 17, 2025 16:39
@changeset-bot
Copy link

changeset-bot bot commented Sep 17, 2025

⚠️ No Changeset found

Latest commit: 2a1923d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@joshblack joshblack added the skip changeset This change does not need a changelog label Sep 17, 2025
@github-actions github-actions bot added the staff Author is a staff member label Sep 17, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the architecture documentation for polymorphic components in the styled-react package to address issues with the as prop, sx prop handling, and component composition. The changes provide a new implementation pattern that correctly transforms sx into className and prevents sx from being passed to wrapped components.

Key changes:

  • Replaces forwardRef pattern with styled-components for polymorphic component implementation
  • Adds proper sx prop filtering using shouldForwardProp
  • Updates the component creation pattern to use styled-components with sx mixin

@github-actions github-actions bot requested a deployment to storybook-preview-6870 September 17, 2025 16:44 Abandoned
@github-actions github-actions bot temporarily deployed to storybook-preview-6870 September 17, 2025 16:52 Inactive
Copy link
Member

@francinelucca francinelucca left a comment

Choose a reason for hiding this comment

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

❤️

@francinelucca francinelucca added this pull request to the merge queue Sep 23, 2025
Merged via the queue into main with commit 1d06308 Sep 23, 2025
42 checks passed
@francinelucca francinelucca deleted the docs/update-architecture-doc-for-styled-react branch September 23, 2025 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip changeset This change does not need a changelog staff Author is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants