Browse Source

Remove react version warning

pull/911/head
afc163 9 years ago
parent
commit
b619f01809
  1. 16
      index.js
  2. 1
      package.json
  3. 1
      scripts/demo.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;

1
package.json

@ -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"

1
scripts/demo.js

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

Loading…
Cancel
Save