Browse Source

Merge pull request #1096 from ant-design/remove-validation

Remove rc-form-validation from deps completely
pull/1162/head
Benjy Cui 9 years ago
parent
commit
55b8d1445b
  1. 24
      components/validation/index.jsx
  2. 1
      package.json

24
components/validation/index.jsx

@ -1,25 +1,15 @@
import React from 'react';
import Validation from 'rc-form-validation';
import warning from 'warning';
export default class AntValidation extends React.Component {
validate(callback) {
this.refs.validation.validate(callback);
}
reset() {
this.refs.validation.reset();
}
forceValidate(fields, callback) {
this.refs.validation.forceValidate(fields, callback);
}
render() {
warning(false, '`Validation` is deprecated, please use `Form` which has supported validation after antd@0.12.0.');
return <Validation {...this.props} ref="validation" />;
warning(false, '`Validation` is removed, please use `Form` which has supported validation after antd@0.12.0,' +
' or you can just import Validation from \'rc-form-validation\' for compatibility');
return null;
}
}
AntValidation.Validator = Validation.Validator;
AntValidation.FieldMixin = Validation.FieldMixin;
AntValidation.Validator = () => {};
AntValidation.FieldMixin = {
setField() {},
};

1
package.json

@ -46,7 +46,6 @@
"rc-dialog": "~5.4.0",
"rc-dropdown": "~1.4.3",
"rc-form": "~0.14.0",
"rc-form-validation": "~2.5.0",
"rc-input-number": "~2.5.0",
"rc-menu": "~4.10.2",
"rc-notification": "~1.3.1",

Loading…
Cancel
Save