[Table] Extended `labelRowsPerPage` support from string to ReactNode
See original GitHub issue- The issue is present in the latest release.
- I have searched the issues of this repository and believe that this is not a duplicate.
Current Behavior 😯
Here you allow to use labelRowsPerPage as React.Node https://github.com/mui-org/material-ui/blob/27471b4564eb40ff769352d73a29938d25804e45/packages/material-ui/src/TablePagination/TablePagination.d.ts#L23
Here you use it as a string https://github.com/mui-org/material-ui/blob/c253b2813822239672b7a2a589324e5e00b97820/packages/material-ui/src/TablePagination/TablePagination.js#L125
So this is vaild but will generate en error “Warning: Failed prop type: Invalid prop aria-label
of type object
supplied to ForwardRef(SelectInput)
, expected string
.”
<TablePagination
labelRowsPerPage={<b>I will warn</b>}
Expected Behavior 🤔
I still want to pass a React.Node without a warning
Your Environment 🌎
Tech | Version |
---|---|
Material-UI | v4.9.9 |
React | 16.13.1 |
Browser | * |
TypeScript | 3.8.3 |
etc. |
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:8 (7 by maintainers)
Top Results From Across the Web
[Table] Extended `labelRowsPerPage` support from string to ...
I'm using material-ui with typescript a lot and there are props that requires only string. The other props requires ReactNode. In my opinion ......
Read more >How to modify the default value of a Material UI prop-function ...
I'm working with React JS and I've imported from Material UI a component called (https://material-ui.com/api/table-pagination/) and I would ...
Read more >material-ui/core/CHANGELOG.md - UNPKG
306, - [Table] Add React node support to TablePagination.labelRowsPerPage (#21226) @oliviertassinari. 307, - [TextField] Fix missing autofill events ...
Read more >Fragments - React
Take this example React snippet: class Table extends React.Component { render() { return ( <table> <tr> <Columns /> </tr> </table> ); } }....
Read more >React with TypeScript Cheatsheet - Bits and Pieces
I hope this section has helped you to understand the different types that can be used for typing React components. How to type...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Is this still open, can i work on this issue?
Sure. That’s why I’m generally in favor.
react-intl
hasuseIntl().formatMessage
for usage in attributes.