React ^15.4.0 升级到 ^16.8.0
"react": "^15.4.0",
"react-dom": "^15.4.0",
"react": "^16.8.0",
"react-dom": "^16.8.0",
npm install react@16.8.0 react-dom@16.8.0 --save
react 16 以下这种方式已经废弃,需要安装 prop-types 引入
npm install prop-types --save
import React, {
Component, PropTypes } from 'react'; // 已废弃
import PropTypes from 'prop-types'; // react 16
Bread.propTypes = {
location: PropTypes.object,
};
升级了之后 一直会报这个错误,最后把 dva 升级到 2.1.0 之后就好了
Dva 1.2.1 升级到 2.1.0
npm install dva@2.1.0 --save
Warning: Please use require("history").createHashHistory
instead of require("history/createHashHistory")
. Support for the latter will be removed in the next major release.
将 node_modules/dva/lib/index.js 里面的 require(‘history/createHashHistory’) 替换。
var _createHashHistory = require('history/createHashHistory')