最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to modify the default value of a Material UI prop-function in React JS? - Stack Overflow

programmeradmin4浏览0评论

I'm working with React JS and I've imported from Material UI a ponent called (/) and I would like to modify the Default of labelDisplayedRows that now is like this:

({ from, to, count }) => ${from}-${to} of ${count}

I would like to edit the "of" of the output, but it's a function, and so i don't know how to do it. If it was a simple node like labelRowsPerPage I would modify it by writing

<TablePagination
                    labelRowsPerPage="text text text"
/>

How could I do it? Thank you in advance

I'm working with React JS and I've imported from Material UI a ponent called (https://material-ui./api/table-pagination/) and I would like to modify the Default of labelDisplayedRows that now is like this:

({ from, to, count }) => ${from}-${to} of ${count}

I would like to edit the "of" of the output, but it's a function, and so i don't know how to do it. If it was a simple node like labelRowsPerPage I would modify it by writing

<TablePagination
                    labelRowsPerPage="text text text"
/>

How could I do it? Thank you in advance

Share Improve this question asked May 28, 2018 at 10:10 M_LudeM_Lude 3651 gold badge4 silver badges14 bronze badges 2
  • Give it a function which returns the string you need? Where exactly is your issue? – ChrisR Commented May 28, 2018 at 10:47
  • the solution is kind like this: <TablePagination labelDisplayedRows={({ from, to, count }) => Displaying pages ${from}-${to} of total ${count} pages}/> – M_Lude Commented May 28, 2018 at 12:19
Add a ment  | 

1 Answer 1

Reset to default 15

Something like this:

<TablePagination labelDisplayedRows={({ from, to, count }) => `Displaying pages ${from}-${to} of total ${count} pages`}/>
发布评论

评论列表(0)

  1. 暂无评论