Skip to content

Commit e89d57c

Browse files
authored
Merge pull request #11135 from marmelab/fix-editbutton-ref-props
[Fix] Buttons ref props
2 parents 0d0ff28 + b6ecabf commit e89d57c

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

packages/ra-ui-materialui/src/button/CloneButton.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,13 @@ const sanitizeRestProps = ({
7373
}: Omit<CloneButtonProps, 'label' | 'scrollToTop' | 'icon'>) => rest;
7474

7575
interface Props {
76+
resource?: string;
7677
record?: any;
7778
icon?: ReactNode;
7879
scrollToTop?: boolean;
7980
}
8081

81-
export type CloneButtonProps = Props & ButtonProps;
82+
export type CloneButtonProps = Props & Omit<ButtonProps<typeof LinkBase>, 'to'>;
8283

8384
export default memo(CloneButton);
8485

packages/ra-ui-materialui/src/button/EditButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ interface Props<RecordType extends RaRecord = any> {
122122
}
123123

124124
export type EditButtonProps<RecordType extends RaRecord = any> =
125-
Props<RecordType> & ButtonProps;
125+
Props<RecordType> & Omit<ButtonProps<typeof LinkBase>, 'to'>;
126126

127127
const PREFIX = 'RaEditButton';
128128

packages/ra-ui-materialui/src/button/ListButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ interface Props {
115115
scrollToTop?: boolean;
116116
}
117117

118-
export type ListButtonProps = Props & ButtonProps;
118+
export type ListButtonProps = Props & Omit<ButtonProps<typeof LinkBase>, 'to'>;
119119

120120
const PREFIX = 'RaListButton';
121121

0 commit comments

Comments
 (0)