Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Material-UI: You are using the typography variant

I develop a web app using react and Material-UI and react. when I use pagination I got below error.

index.js:1452 Warning: Material-UI: You are using the typography variant caption which will be restyled in the next major release. 
Please read the migration guide under https://material-ui.com/style/typography#migration-to-typography-v2

I use below way in pagination in my code

import TablePagination from '@material-ui/core/TablePagination';

<TablePagination
    component="div"
    count={this.handleChangeFilter(searchedVal).length}
    rowsPerPage={rowsPerPage}
    page={page}
    backIconButtonProps={{
        'aria-label': 'Previous Page',
    }}
    nextIconButtonProps={{
        'aria-label': 'Next Page',
    }}
    onChangePage={this.handleChangePage}
    onChangeRowsPerPage={this.handleChangeRowsPerPage}
/>

please tell me how slove it error image in below

enter image description here

like image 585
Thilina Sampath Avatar asked Jan 28 '26 13:01

Thilina Sampath


1 Answers

This error means the typography will change in the next version ,so you should migrate to the next version.The https://v3.mui.com/style/typography/#migration-to-typography-v2 give you a guide on how to migrate to the next version by adding this:

const theme = createMuiTheme({
  typography: {
    useNextVariants: true,
  },
});
like image 114
Root Avatar answered Jan 31 '26 08:01

Root



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!