-
Notifications
You must be signed in to change notification settings - Fork 625
refactor(Stack): Remove sx prop support from the Stack component #6610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 69d64eb The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks! |
size-limit report 📦
|
👋 Hi from github/github! Your integration PR is ready: https://github.com/github/github/pull/396686 |
🟢 golden-jobs completed with status |
There was a problem hiding this 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 removes sx
prop support from the Stack component by replacing the BoxWithFallback
wrapper with direct element rendering. This is a breaking change that simplifies the Stack component's implementation by eliminating styled-system functionality.
Key changes:
- Replace
BoxWithFallback
with direct component rendering for both Stack and StackItem - Remove the
BoxWithFallback
import that providedsx
prop support - Default the
as
prop to 'div' directly in the destructuring assignment
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
packages/react/src/Stack/Stack.tsx | Remove BoxWithFallback wrapper and sx prop support, use direct component rendering |
.changeset/young-dots-heal.md | Add major version changeset documenting the breaking change |
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
ref={forwardedRef} | ||
{...rest} | ||
className={clsx(className, classes.StackItem)} | ||
{...getResponsiveAttributes('grow', grow)} | ||
{...getResponsiveAttributes('shrink', shrink)} | ||
> | ||
{children} | ||
</BoxWithFallback> | ||
</Component> | ||
) | ||
}) as PolymorphicForwardRefComponent<ElementType, StackProps<ElementType>> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type assertion for StackItem should reference StackItemProps<ElementType>
instead of StackProps<ElementType>
to match the correct props interface.
}) as PolymorphicForwardRefComponent<ElementType, StackProps<ElementType>> | |
}) as PolymorphicForwardRefComponent<ElementType, StackItemProps<ElementType>> |
Copilot uses AI. Check for mistakes.
Closes https://github.com/github/primer/issues/5716
Changelog
New
Changed
Removed
Remove sx prop support from the Stack component
Rollout strategy
Testing & Reviewing
Merge checklist