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'``;



目录
相关文章
|
资源调度 前端开发 JavaScript
React 安装(NPM)
10月更文挑战第6天
423 1
|
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.
524 2
|
前端开发
React踩坑-安装npm install fetch-jsonp报错
React踩坑-安装npm install fetch-jsonp报错
247 0
|
资源调度 前端开发
React npm i @ant-design/ --save无法导入问题
React npm i @ant-design/ --save无法导入问题
422 0
|
前端开发 定位技术
react中使用百度地图报错:‘BMapGL‘ is not defined no-undef解决方法
react中使用百度地图报错:‘BMapGL‘ is not defined no-undef解决方法
|
缓存 资源调度 JavaScript
【React工作记录八十九】npm,cnpm,yarn简单对比笔记
【React工作记录八十九】npm,cnpm,yarn简单对比笔记
211 0
react-Native init初始化项目报错”TypeError: cli.init is not a function“
react-Native init初始化项目报错”TypeError: cli.init is not a function“
1431 1
|
前端开发 定位技术 API
react BMap is not defined 或者 BMapGL is not defined
react BMap is not defined 或者 BMapGL is not defined
1154 0
|
前端开发 API
react报错ReactDOM.render is no longer supported in React 18. 解决
react报错ReactDOM.render is no longer supported in React 18. 解决
648 0
|
前端开发 JavaScript
rollup从0到1将react组件库打包发布npm
rollup从0到1将react组件库打包发布npm记录全过程
1139 1
rollup从0到1将react组件库打包发布npm