diff --git a/components/validation/index.jsx b/components/validation/index.jsx index 198cca8668..99c88ab43f 100644 --- a/components/validation/index.jsx +++ b/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 ; + 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() {}, +}; diff --git a/package.json b/package.json index 416565f6d6..91b1109980 100644 --- a/package.json +++ b/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",