Skip to content

[TablePagination][material-ui] Type error for hiddenLabel prop in SelectProps #38487

Closed
@MonstraG

Description

@MonstraG

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Steps to reproduce 🕹

Link to live example:
https://codesandbox.io/s/pensive-bardeen-2kq5g6?file=/src/App.tsx

Current behavior 😯

Typescript error
No overload matches this call.
  Overload 1 of 2, '(props: { component: "div"; } & TablePaginationBaseProps & { ActionsComponent?: ElementType<TablePaginationActionsProps>; ... 15 more ...; sx?: SxProps<...>; } & CommonProps & Omit<...>): Element', gave the following error.
    Type '{ variant: "filled"; size: "small"; hiddenLabel: true; disableUnderline: true; }' is not assignable to type 'Partial<SelectProps<unknown>>'.
      Object literal may only specify known properties, and 'hiddenLabel' does not exist in type 'Partial<SelectProps<unknown>>'.
  Overload 2 of 2, '(props: DefaultComponentProps<TablePaginationTypeMap<{}, JSXElementConstructor<TablePaginationBaseProps>>>): Element', gave the following error.
    Type '{ variant: "filled"; size: "small"; hiddenLabel: true; disableUnderline: true; }' is not assignable to type 'Partial<SelectProps<unknown>>'.
      Object literal may only specify known properties, and 'hiddenLabel' does not exist in type 'Partial<SelectProps<unknown>>'.ts(2769)

But hiddenLabel works

Expected behavior 🤔

Everything works without errors

Context 🔦

Workaround:

SelectProps={
	{
		variant: "filled",
		size: "small",
		hiddenLabel: true,
		disableUnderline: true
	} as Omit<FilledInputProps, "onChange">
}

Your environment 🌎

See live link

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐛Something doesn't workcomponent: TablePaginationThe React component.component: selectThis is the name of the generic UI component, not the React module!package: material-uiSpecific to @mui/materialready to takeHelp wanted. Guidance available. There is a high chance the change will be acceptedtypescript

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions