question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

component property is not on TablePaginationProps

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
cchooleycommented, May 4, 2021

Still going on for sure (among other prop type errors that get reported when dropping the example from the docs directly into an empty .tsx file). Very peculiar as I would expect to be able to drop the example code directly into a blank file w/ no (or at least very minimal) errors reported.

Screen Shot 2021-05-04 at 10 08 28 AM
1reaction
eps1loncommented, Jun 16, 2021

@probablyVincentIp Thanks for the hint 👍 Updated to refer to https://github.com/mui-org/material-ui/issues/15827

Read more comments on GitHub >

github_iconTop Results From Across the Web

component property is not on TablePaginationProps #24372
The documentation shows that component is a property of type TablePaginationProps. Instantiating an object of this type does not allow for this property....
Read more >
Material UI material-table TablePagination issue. (React)
If I try to paginate it throws error in console. Uncaught TypeError: _this.props.onChangePage is not a function. Sample Code: <MaterialTable ...
Read more >
TablePagination API - Material UI - MUI
API reference docs for the React TablePagination component. Learn about the props, CSS, and other APIs of this exported module.
Read more >
property 'component' does not exist on type 'intrinsicattributes
Components have only one parameter which is the props object, therefore your function ... Property 'component' does not exist on type 'IntrinsicAttributes.
Read more >
The Ultimate Guide to Material-UI Table Pagination (MUI v5)
1 How to Use the TablePagination Component (Every Prop Enabled) ... Interestingly not all props of the IconButton worked, for example I ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found