安装命令:
npm i eslint-plugin-react-hooks -D
安装完成之后,打开package.json文件修改配置:
将原配置修改为:
代码如下:
"eslintConfig": {
"extends": "react-app",
"plugins":[
"react-hooks"
],
"rules":{
"react-hooks/rules-of-hooks":"error"
}
},
安装命令:
npm i eslint-plugin-react-hooks -D
安装完成之后,打开package.json文件修改配置:
将原配置修改为:
代码如下:
"eslintConfig": {
"extends": "react-app",
"plugins":[
"react-hooks"
],
"rules":{
"react-hooks/rules-of-hooks":"error"
}
},