reactjs - Material-UI:您正在使用排版变体
问题描述
我使用 react 和 Material-UI 开发了一个 Web 应用程序并做出了反应。当我使用分页时,出现以下错误。
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
我在代码中使用以下方式进行分页
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}
/>
请告诉我如何解决它下面的错误图片
解决方案
此错误意味着排版将在下一个版本中更改,因此您应该迁移到下一个版本。https: //v3.mui.com/style/typography/#migration-to-typography-v2为您提供有关如何操作的指南通过添加以下内容迁移到下一个版本:
const theme = createMuiTheme({
typography: {
useNextVariants: true,
},
});
推荐阅读
- php - 未安装/加载/启用 PHP 扩展,使用官方 PHP docker 镜像
- javascript - 如何保护可能从浏览器源代码中窃取的 Angular js 应用程序代码?
- c# - 无法将普通 C# 类转换为 MVC 模型类
- java - 文本组合框工厂调用
- android - NativeMessageHandler+
System.OperationCanceledException:操作被取消 - regex - Apache 2.4 - 不同 url 模式的 IF 块
- java - InfluxDB 是否提供 Java API?
- android - AndEngine 64位版本
- sql - 如何在sql中重新排序跳过的数字
- typescript - 如何在Angular 7中的POST方法中捕获响应