Remove react version warning

This commit is contained in:
afc163 2016-01-15 16:34:49 +08:00
parent 71a76806d2
commit b619f01809
3 changed files with 1 additions and 17 deletions

View File

@ -1,7 +1,5 @@
// this file is not used if use https://github.com/ant-design/babel-plugin-antd
const React = require('react');
const antd = {
Affix: require('./components/affix'),
DatePicker: require('./components/date-picker'),
@ -49,18 +47,4 @@ const antd = {
Cascader: require('./components/cascader'),
};
if (process.env.NODE_ENV !== 'production') {
antd.version = require('./package.json').version;
const ReactVersion = React.version;
const warning = require('warning');
const semver = require('semver');
const reactVersionInDeps = require('./package.json').devDependencies.react;
warning(
semver.satisfies(ReactVersion, reactVersionInDeps) ||
semver.gtr(ReactVersion, reactVersionInDeps),
`antd@${antd.version} need react@${reactVersionInDeps} or higher, ` +
`which is react@${ReactVersion} now.`
);
}
module.exports = antd;

View File

@ -67,7 +67,6 @@
"rc-upload": "~1.8.0",
"rc-util": "~3.0.1",
"react-slick": "~0.9.1",
"semver": "~5.1.0",
"util-deprecate": "~1.0.1",
"velocity-animate": "~1.2.2",
"warning": "~2.1.0"

View File

@ -257,4 +257,5 @@ InstantClickChangeFns.push(function() {
});
});
antd.version = require('../package.json').version;
module.exports = antd;