Skip to content

Commit a05bc22

Browse files
authored
[ButtonBase] Remove buttonRef prop (#25896)
1 parent f389f2c commit a05bc22

File tree

3 files changed

+3
-17
lines changed

3 files changed

+3
-17
lines changed

docs/src/pages/guides/migration-v4/migration-v4.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,8 @@ As the core components use emotion as a styled engine, the props used by emotion
478478
+<Button />
479479
```
480480

481+
- [ButtonBase] Remove the deprecated `buttonRef` prop. The `ref` prop should be used in place.
482+
481483
### Chip
482484

483485
- Rename `default` variant to `filled` for consistency.

packages/material-ui/src/ButtonBase/ButtonBase.d.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,6 @@ export interface ButtonBaseTypeMap<P = {}, D extends React.ElementType = 'button
1111
* It currently only supports `focusVisible()` action.
1212
*/
1313
action?: React.Ref<ButtonBaseActions>;
14-
/**
15-
* @ignore
16-
*
17-
* Use that prop to pass a ref to the native button component.
18-
* @deprecated Use `ref` instead.
19-
*/
20-
buttonRef?: React.Ref<unknown>;
2114
/**
2215
* If `true`, the ripples are centered.
2316
* They won't start at the cursor interaction position.

packages/material-ui/src/ButtonBase/ButtonBase.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ const ButtonBase = React.forwardRef(function ButtonBase(inProps, ref) {
7474
const props = useThemeProps({ props: inProps, name: 'MuiButtonBase' });
7575
const {
7676
action,
77-
buttonRef: buttonRefProp,
7877
centerRipple = false,
7978
children,
8079
className,
@@ -299,9 +298,8 @@ const ButtonBase = React.forwardRef(function ButtonBase(inProps, ref) {
299298
buttonProps['aria-disabled'] = disabled;
300299
}
301300

302-
const handleUserRef = useForkRef(buttonRefProp, ref);
303301
const handleOwnRef = useForkRef(focusVisibleRef, buttonRef);
304-
const handleRef = useForkRef(handleUserRef, handleOwnRef);
302+
const handleRef = useForkRef(ref, handleOwnRef);
305303

306304
const [mountedState, setMountedState] = React.useState(false);
307305

@@ -382,13 +380,6 @@ ButtonBase.propTypes /* remove-proptypes */ = {
382380
* It currently only supports `focusVisible()` action.
383381
*/
384382
action: refType,
385-
/**
386-
* @ignore
387-
*
388-
* Use that prop to pass a ref to the native button component.
389-
* @deprecated Use `ref` instead.
390-
*/
391-
buttonRef: refType,
392383
/**
393384
* If `true`, the ripples are centered.
394385
* They won't start at the cursor interaction position.

0 commit comments

Comments
 (0)