Skip to content

Commit 93517ed

Browse files
committed
Improve excludeProp
1 parent 923a73e commit 93517ed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { StyledOptions } from '@mui/styled-engine';
22

3-
export function excludeProp<T extends string>(
4-
list: readonly T[]
3+
export function excludeProp<T extends string | AnyObject, L = T extends string ? T : keyof T>(
4+
list: readonly L[]
55
): NonNullable<StyledOptions['shouldForwardProp']> {
66
return (prop) => !(list as readonly string[]).includes(prop);
77
}

0 commit comments

Comments
 (0)