Skip to content

Commit 1c1dcac

Browse files
committed
Improve props
1 parent 8cd193c commit 1c1dcac

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Button/Button.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* eslint-disable @typescript-eslint/no-empty-object-type */
22
import React from 'react';
33
import styled from '@mui/system/styled';
4+
import type { MUIStyledCommonProps } from '@mui/system';
45
import { Flex, type FlexAllProps, type FlexComponentProps } from 'reflexy/styled';
56
import type { GetOverridedKeys } from '../types/local';
67
import type { CSSProperties } from '../theme';
@@ -25,7 +26,8 @@ export interface ButtonStyleProps {
2526
}
2627

2728
export type ButtonProps<C extends React.ElementType = 'button'> = FlexAllProps<C> &
28-
ButtonStyleProps;
29+
ButtonStyleProps &
30+
Pick<MUIStyledCommonProps, 'sx'>;
2931

3032
// function excludeHoverRules<T extends AnyObject | undefined>(rules: T): T {
3133
// if (rules == null) return rules;
@@ -300,5 +302,5 @@ const Root = styled(
300302
export default function Button<C extends React.ElementType = 'button'>(
301303
props: ButtonProps<C>
302304
): React.JSX.Element {
303-
return <Root {...(props as any)} />;
305+
return <Root {...props} />;
304306
}

0 commit comments

Comments
 (0)