试图在现有项目中从反应15.6.1移至反应16.8.5,并得到以下错误:
我认为这可能是由propTypes引起的,所以我从各处删除了带有propTypes的代码。但是它没有帮助。
我的webpack配置:
var path = require('path');
var webpack = require('webpack');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
module.exports = {
devtool: 'cheap-module-eval-source-map',
entry: [
'webpack-dev-server/client?http://localhost:5050',
// 'webpack/hot/only-dev-server',
// 'react-hot-loader/patch',
'./index'
],
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/static/'
},
resolve: {
extensions: ['', '.js', '.jsx', '.css'],
alias: { 'react/lib/ReactMount': 'react-dom/lib/ReactMount' }
},
plugins: [
// new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
// new BundleAnalyzerPlugin()
],
module: {
loaders: [{
test: /\.js$/,
loaders: ['babel-loader'],
// loaders: ['react-hot-loader', 'babel-loader'],
exclude: /node_modules/,
include: __dirname
},
{
test: /\.css$/,
loaders: [
'style', 'css',
],
},
{
test: /\.(png|woff|woff2|eot|ttf|svg|gif)(\?v=[0-9]\.[0-9]\.[0-9])?$/,
loaders: ['url']
}
]
},
devServer: {
historyApiFallback: true,
},
};
这是回购链接; Github
ReduxRouter错误代码:
var ReduxRouter = (function (_Component) {
_inherits(ReduxRouter, _Component);
_createClass(ReduxRouter, null, [{
key: 'propTypes',
value: {
**children: _react.PropTypes.node**
},
enumerable: true
}, {
key: 'contextTypes',
value: {
store: _react.PropTypes.object
},
enumerable: true
}]);