React.PropTypes is deprecated since React 15.5.0, use the npm module prop-types instead react/no-de

简介: React.PropTypes is deprecated since React 15.5.0, use the npm module prop-types instead react/no-de
/src/models/products.js
  Line 1:  'dva' is defined but never used  no-unused-vars
./src/components/ProductList.js
  Line 1:  React.PropTypes is deprecated since React 15.5.0, use the npm module prop-types instead  react/no-deprecated
Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.


解决办法:


npm``install``--save prop-types

或者yarn add prop-types


然后在需要使用PropTypes属性的地方引入:

import PropTypes from ``'prop-types'``;



目录
相关文章
|
11月前
|
资源调度 前端开发
React npm i @ant-design/ --save无法导入问题
React npm i @ant-design/ --save无法导入问题
151 0
|
8月前
npm run dev启动报错:Error: Cannot find module 'semver'
npm run dev启动报错:Error: Cannot find module 'semver'
161 0
|
8月前
|
小程序
小程序wepy踩坑-Cannot find module 'D:\node_modules\npm\bin\npm-cli.js'
小程序wepy踩坑-Cannot find module 'D:\node_modules\npm\bin\npm-cli.js'
166 0
|
11月前
react-Native init初始化项目报错”TypeError: cli.init is not a function“
react-Native init初始化项目报错”TypeError: cli.init is not a function“
580 1
|
1天前
|
JavaScript
vue : 无法加载文件 D:\module\npm_module\npm_modules\vue.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft.c
vue : 无法加载文件 D:\module\npm_module\npm_modules\vue.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft.c
|
4天前
|
JavaScript
# 解决输入任何npm命令都报Error: Cannot find module ‘are-we-there-yet‘
# 解决输入任何npm命令都报Error: Cannot find module ‘are-we-there-yet‘
|
2月前
|
JSON 资源调度 JavaScript
ES Module使用-原理-包管理工具npm(一)
ES Module使用-原理-包管理工具npm
97 0
ES Module使用-原理-包管理工具npm(一)
|
2月前
|
存储 缓存 资源调度
ES Module使用-原理-包管理工具npm(二)
ES Module使用-原理-包管理工具npm
91 0
|
2月前
|
JavaScript
报错:npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
报错:npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
|
8月前
|
前端开发
React踩坑-安装npm install fetch-jsonp报错
React踩坑-安装npm install fetch-jsonp报错
45 0