11import * as React from 'react' ;
2+ import type { DynamicRefForwardingComponent } from './types.js' ;
23
34export type ButtonType = 'button' | 'reset' | 'submit' ;
45
@@ -108,7 +109,7 @@ export function useButtonProps({
108109 ] ;
109110}
110111
111- export interface BaseButtonProps {
112+ export interface ButtonProps {
112113 /**
113114 * Control the underlying rendered element directly by passing in a valid
114115 * component type
@@ -127,21 +128,18 @@ export interface BaseButtonProps {
127128 rel ?: string | undefined ;
128129}
129130
130- export interface ButtonProps
131- extends BaseButtonProps ,
132- React . ComponentPropsWithoutRef < 'button' > { }
133-
134- const Button = React . forwardRef < HTMLElement , ButtonProps > (
135- ( { as : asProp , disabled, ...props } , ref ) => {
136- const [ buttonProps , { tagName : Component } ] = useButtonProps ( {
137- tagName : asProp ,
138- disabled,
139- ...props ,
140- } ) ;
141-
142- return < Component { ...props } { ...buttonProps } ref = { ref } /> ;
143- } ,
144- ) ;
131+ const Button : DynamicRefForwardingComponent < 'button' , ButtonProps > =
132+ React . forwardRef < HTMLElement , ButtonProps > (
133+ ( { as : asProp , disabled, ...props } , ref ) => {
134+ const [ buttonProps , { tagName : Component } ] = useButtonProps ( {
135+ tagName : asProp ,
136+ disabled,
137+ ...props ,
138+ } ) ;
139+
140+ return < Component { ...props } { ...buttonProps } ref = { ref } /> ;
141+ } ,
142+ ) ;
145143
146144Button . displayName = 'Button' ;
147145
0 commit comments