Skip to content
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

[useButton] Modernize implementation #643

Merged
merged 3 commits into from
Oct 2, 2024

Conversation

michaldudak
Copy link
Member

@michaldudak michaldudak commented Sep 23, 2024

  • Removed the active and focus-visible polyfills
  • Removed link support
  • Moved types to namespaces

Closes #47

@michaldudak michaldudak added the component: button This is the name of the generic UI component, not the React module! label Sep 23, 2024
@mui-bot
Copy link

mui-bot commented Sep 23, 2024

Netlify deploy preview

https://deploy-preview-643--base-ui.netlify.app/

Generated by 🚫 dangerJS against 8e90c80

Comment on lines 178 to 181
/**
* A ref to the component's root DOM element.
*/
rootRef: React.RefCallback<Element> | null;
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be called buttonRef now. The root idea is confusing

Comment on lines 162 to 180
/**
* The HTML element, e.g.'button', 'span' etc.
* @default ''
*/
rootElementName?: keyof HTMLElementTagNameMap;
}

export interface ReturnValue {
/**
* Resolver for the root slot's props.
* @param externalProps additional props for the root slot
* @returns props that should be spread on the root slot
*/
getRootProps: (
externalProps?: React.ComponentPropsWithRef<any>,
) => React.ComponentPropsWithRef<any>;
/**
* A ref to the component's root DOM element.
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

A couple more roots

@michaldudak michaldudak mentioned this pull request Oct 1, 2024
14 tasks
@michaldudak michaldudak merged commit 1e5e490 into mui:master Oct 2, 2024
17 of 18 checks passed
@michaldudak michaldudak deleted the modernize-useButton branch October 2, 2024 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: button This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove workarounds for unsupported browsers
3 participants