Skip to content

Conversation

ZakaryH
Copy link
Contributor

@ZakaryH ZakaryH commented Oct 15, 2025

Motivations

minor improvement I wanted to hop on before we have to deal with backwards compatibility via people using the props in their current state

destructive

having it as a boolean is not great for a few reasons that Eric pointed out on the PR. 1. can't extend it easily in the future if say we have a "success" or "informational" equivalent and 2. if we ever did have 2 things that want to style, it gets tough to validate this <MenuItem destructive informational> of course it's a bit silly to do that, and that somewhat solves itself if you just don't do that, but there's also an easy, established pattern to avoid this via variation that we make use of pretty often. so now it's variation: "destructive" | "informational" and you choose exactly one, and it's easy to add to in the future.

then a minor, non functional change the the type on children this one I'm a bit less sure about. I realized that in the future, we don't want that wrapping div as a child of AriaPressable but when it's just children directly, the types don't like this because we have it as ReactNode and Pressable is a bit more particular about what it accepts.

functionally this will have no difference now. it's just if we remove the div, the types are still happy - so it becomes less prone to changes later. the only thing I'm not sure about is that this is actually not required in one scenario

if we make our Button a wrapper around AriaButton, then you don't even need Pressable at all, and then the type I'm adding now isn't required.

it's possible that we wait until we're certain. while yes, changing the type is technically breaking and the longer we wait the more risk we have that someone violates it, realistically no one should be putting in non interactive elements as the Trigger, and that's the only case where it might get upset.

Changes

Added

Changed

Deprecated

Removed

Fixed

Security

Testing

Changes can be
tested via Pre-release


In Atlantis we use Github's built in pull request reviews.

};

const variation = {
const animationVariation = {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

"variation" was getting in the way of the new prop name

this version is just internal anyway for the framer config

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant