fab variant 将被移除

报错或提示:

1
Warning: Failed prop type: The `fab` variant will be removed in the next major release. The `<Fab>` component is equivalent and should be used instead.

通常出现在头部组件里,例如 app/components/Header/Header.js。

原写法:

1
2
3
4
5
6
7
8
9
10
11
import Button from '@material-ui/core/Button'

<Button
variant="fab"
mini
className={classes.menuButton}
aria-label="Menu"
onClick={toggleDrawerOpen}
>
<MenuIcon />
</Button>

替换为:

1
2
3
4
5
6
7
8
9
10
11
import Fab from '@material-ui/core/Fab'

<Fab
color="primary"
size="small"
className={classes.menuButton}
aria-label="Menu"
onClick={toggleDrawerOpen}
>
<MenuIcon />
</Fab>

DLL manifest 缺失

报错:

1
The DLL manifest is missing. Please run `npm run build:dll`.

处理方式:

1
npm run build:dll

如果是安装依赖后出现,也要确认依赖是否安装在正确项目里。历史处理里曾经用过全局安装,例如:

1
npm i -g @fortawesome/react-fontawesome

不过更推荐优先把依赖写入当前项目的 package.json。

文件末尾缺少空行

报错:

1
2
3
4
Module Error (from ./node_modules/eslint-loader/index.js):

C:\Users\leroi\Desktop\themeforest-update\dandelion_pro_v130\starter-project\app\containers\pageListAsync.js
59:4 error Newline required at end of file but not found eol-last

处理方式:

在提示文件末尾补一个空行,保存后重新运行检查。

CRLF 和 LF 换行不一致

报错:

1
error Expected linebreaks to be 'LF' but found 'CRLF' linebreak-style

处理方式:

在 .eslintrc.js 的 rules 中调整换行规则:

1
2
3
4
5
module.exports = {
rules: {
'linebreak-style': [0, 'error', 'windows']
}
}

如果团队成员同时使用 Windows 和 macOS,更建议配合 .editorconfig 统一换行。


本文早期发布于个人 CSDN 博客:查看原文

站内搜索

没有找到内容!