Skip to content

component property is not on TablePaginationProps  #24372

Closed
@confirmedVincentIp

Description

@confirmedVincentIp

The documentation shows that component is a property of type TablePaginationProps. Instantiating an object of this type does not allow for this property.

Issue potentially because of this line: https://github.com/mui-org/material-ui/blob/c19917c0bee7ddc1980ec48891c13297965c5542/packages/material-ui/src/TablePagination/TablePagination.d.ts#L66

Current Behavior 😯

a Typescript error is shown

Object literal may only specify known properties, and 'component' does not exist in type 

Expected Behavior 🤔

The property should be available on TablePaginationProps type (or documentation should be updated to reflect the removal of this property)

Steps to Reproduce 🕹

https://codesandbox.io/s/material-demo-forked-fv6nu?file=/demo.tsx

Steps:

  1. import TablePagination, { TablePaginationProps } from "@material-ui/core/TablePagination";
  2. instantiate variable of type TablePaginationProps
  3. include component property in object

Context 🔦

I am trying to wrap the TablePagination component and export it together with its proptype

Your Environment 🌎

`npx @material-ui/envinfo`
  Don't forget to mention which browser you used.
  Output from `npx @material-ui/envinfo` goes here.

System:
OS: macOS 11.1
Binaries:
Node: 14.3.0 - /usr/local/bin/node
Yarn: 1.22.5 - ~/.yarn/bin/yarn
npm: 6.14.4 - /usr/local/bin/npm
Browsers:
Chrome: 87.0.4280.141
Edge: 87.0.664.75
Firefox: 85.0
Safari: 14.0.2
npmPackages:
@emotion/styled: 10.0.27
@material-ui/core: ^4.11.0 => 4.11.1
@material-ui/icons: ^4.9.1 => 4.9.1
@material-ui/lab: ^4.0.0-alpha.56 => 4.0.0-alpha.56
@material-ui/pickers: ^3.2.10 => 3.2.10
@material-ui/styles: ^4.10.0 => 4.11.1
@material-ui/system: 4.9.14
@material-ui/types: 5.1.0
@material-ui/utils: 4.10.2
@types/react: latest => 17.0.0
react: ^16.13.1 => 16.14.0
react-dom: ^16.13.1 => 16.14.0
styled-components: ^5.2.0 => 5.2.1
typescript: latest => 4.1.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: tableThis is the name of the generic UI component, not the React module!typescript

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions