mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 02:59:58 +08:00
Remove react version warning
This commit is contained in:
parent
71a76806d2
commit
b619f01809
16
index.js
16
index.js
@ -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;
|
||||
|
@ -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"
|
||||
|
@ -257,4 +257,5 @@ InstantClickChangeFns.push(function() {
|
||||
});
|
||||
});
|
||||
|
||||
antd.version = require('../package.json').version;
|
||||
module.exports = antd;
|
||||
|
Loading…
Reference in New Issue
Block a user